@@ -21,12 +21,19 @@ const conversationStore = useConversationStore()
21
21
onMounted (() => {
22
22
// Fetch list based on type
23
23
if (type .value ) {
24
- conversationStore .setListStatus (CONVERSATION_DEFAULT_STATUSES .OPEN , false )
24
+ // Set list status if not already set
25
+ if (! conversationStore .getListStatus ) {
26
+ conversationStore .setListStatus (CONVERSATION_DEFAULT_STATUSES .OPEN , false )
27
+ }
25
28
conversationStore .resetCurrentConversation ()
26
29
conversationStore .fetchConversationsList (true , type .value )
27
30
}
28
31
// Fetch team list.
29
32
if (teamID .value ) {
33
+ // Set list status if not already set
34
+ if (! conversationStore .getListStatus ) {
35
+ conversationStore .setListStatus (CONVERSATION_DEFAULT_STATUSES .OPEN , false )
36
+ }
30
37
conversationStore .resetCurrentConversation ()
31
38
conversationStore .fetchConversationsList (
32
39
true ,
@@ -36,6 +43,8 @@ onMounted(() => {
36
43
}
37
44
// Fetch view list.
38
45
if (viewID .value ) {
46
+ // Empty out list status as views are already filtered.
47
+ conversationStore .setListStatus (' ' , false )
39
48
conversationStore .resetCurrentConversation ()
40
49
conversationStore .fetchConversationsList (true , CONVERSATION_LIST_TYPE .VIEW , 0 , [], viewID .value )
41
50
}
@@ -46,16 +55,26 @@ watch(
46
55
[type, teamID, viewID],
47
56
([newType , newTeamID , newViewID ], [oldType , oldTeamID , oldViewID ]) => {
48
57
if (newType !== oldType && newType) {
58
+ // Set list status if not already set
59
+ if (! conversationStore .getListStatus ) {
60
+ conversationStore .setListStatus (CONVERSATION_DEFAULT_STATUSES .OPEN , false )
61
+ }
49
62
conversationStore .fetchConversationsList (true , newType)
50
63
}
51
64
if (newTeamID !== oldTeamID && newTeamID) {
65
+ // Set list status if not already set
66
+ if (! conversationStore .getListStatus ) {
67
+ conversationStore .setListStatus (CONVERSATION_DEFAULT_STATUSES .OPEN , false )
68
+ }
52
69
conversationStore .fetchConversationsList (
53
70
true ,
54
71
CONVERSATION_LIST_TYPE .TEAM_UNASSIGNED ,
55
72
newTeamID
56
73
)
57
74
}
58
75
if (newViewID !== oldViewID && newViewID) {
76
+ // Empty out list status as views are already filtered.
77
+ conversationStore .setListStatus (' ' , false )
59
78
conversationStore .fetchConversationsList (true , CONVERSATION_LIST_TYPE .VIEW , 0 , [], newViewID)
60
79
}
61
80
}
0 commit comments