@droppii-org/chat-mobile 0.2.86 → 0.2.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/module/core/useChatListener.js +4 -0
- package/lib/module/core/useChatListener.js.map +1 -1
- package/lib/module/hooks/contacts/useSearchContacts.js +3 -2
- package/lib/module/hooks/contacts/useSearchContacts.js.map +1 -1
- package/lib/module/hooks/groups/useDismissGroup.js +6 -0
- package/lib/module/hooks/groups/useDismissGroup.js.map +1 -1
- package/lib/module/hooks/groups/useFetchPublicGroup.js +3 -2
- package/lib/module/hooks/groups/useFetchPublicGroup.js.map +1 -1
- package/lib/module/hooks/groups/useGroupAccessGuard.js +6 -0
- package/lib/module/hooks/groups/useGroupAccessGuard.js.map +1 -1
- package/lib/module/hooks/groups/useLeaveGroup.js +9 -2
- package/lib/module/hooks/groups/useLeaveGroup.js.map +1 -1
- package/lib/module/hooks/message/useSearchMessage.js +3 -2
- package/lib/module/hooks/message/useSearchMessage.js.map +1 -1
- package/lib/module/screens/SearchConversation/SearchAllResult.js +29 -22
- package/lib/module/screens/SearchConversation/SearchAllResult.js.map +1 -1
- package/lib/module/screens/SearchConversation/SearchCommunityResult.js +3 -2
- package/lib/module/screens/SearchConversation/SearchCommunityResult.js.map +1 -1
- package/lib/module/screens/SearchConversation/SearchContactsResult.js +4 -2
- package/lib/module/screens/SearchConversation/SearchContactsResult.js.map +1 -1
- package/lib/module/screens/SearchConversation/SearchMessagesResult.js +4 -2
- package/lib/module/screens/SearchConversation/SearchMessagesResult.js.map +1 -1
- package/lib/module/screens/SearchConversation/TabResult.js +10 -5
- package/lib/module/screens/SearchConversation/TabResult.js.map +1 -1
- package/lib/module/utils/groupExit.js +25 -0
- package/lib/module/utils/groupExit.js.map +1 -0
- package/lib/typescript/src/core/useChatListener.d.ts.map +1 -1
- package/lib/typescript/src/hooks/contacts/useSearchContacts.d.ts +2 -1
- package/lib/typescript/src/hooks/contacts/useSearchContacts.d.ts.map +1 -1
- package/lib/typescript/src/hooks/groups/useDismissGroup.d.ts.map +1 -1
- package/lib/typescript/src/hooks/groups/useFetchPublicGroup.d.ts +1 -1
- package/lib/typescript/src/hooks/groups/useFetchPublicGroup.d.ts.map +1 -1
- package/lib/typescript/src/hooks/groups/useGroupAccessGuard.d.ts.map +1 -1
- package/lib/typescript/src/hooks/groups/useLeaveGroup.d.ts.map +1 -1
- package/lib/typescript/src/hooks/message/useSearchMessage.d.ts +2 -1
- package/lib/typescript/src/hooks/message/useSearchMessage.d.ts.map +1 -1
- package/lib/typescript/src/screens/SearchConversation/SearchAllResult.d.ts +2 -1
- package/lib/typescript/src/screens/SearchConversation/SearchAllResult.d.ts.map +1 -1
- package/lib/typescript/src/screens/SearchConversation/SearchCommunityResult.d.ts +2 -1
- package/lib/typescript/src/screens/SearchConversation/SearchCommunityResult.d.ts.map +1 -1
- package/lib/typescript/src/screens/SearchConversation/SearchContactsResult.d.ts +2 -1
- package/lib/typescript/src/screens/SearchConversation/SearchContactsResult.d.ts.map +1 -1
- package/lib/typescript/src/screens/SearchConversation/SearchMessagesResult.d.ts +2 -1
- package/lib/typescript/src/screens/SearchConversation/SearchMessagesResult.d.ts.map +1 -1
- package/lib/typescript/src/screens/SearchConversation/TabResult.d.ts.map +1 -1
- package/lib/typescript/src/utils/groupExit.d.ts +4 -0
- package/lib/typescript/src/utils/groupExit.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/core/useChatListener.ts +4 -0
- package/src/hooks/contacts/useSearchContacts.ts +3 -1
- package/src/hooks/groups/useDismissGroup.tsx +8 -0
- package/src/hooks/groups/useFetchPublicGroup.ts +2 -1
- package/src/hooks/groups/useGroupAccessGuard.ts +6 -0
- package/src/hooks/groups/useLeaveGroup.tsx +12 -2
- package/src/hooks/message/useSearchMessage.ts +3 -1
- package/src/screens/SearchConversation/SearchAllResult.tsx +25 -15
- package/src/screens/SearchConversation/SearchCommunityResult.tsx +7 -2
- package/src/screens/SearchConversation/SearchContactsResult.tsx +7 -1
- package/src/screens/SearchConversation/SearchMessagesResult.tsx +7 -1
- package/src/screens/SearchConversation/TabResult.tsx +7 -0
- package/src/utils/groupExit.ts +26 -0
|
@@ -11,7 +11,8 @@ import { SearchEmpty } from "./SearchEmpty.js";
|
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
const SearchMessagesResult = /*#__PURE__*/memo(({
|
|
13
13
|
searchTerm,
|
|
14
|
-
onPressItem
|
|
14
|
+
onPressItem,
|
|
15
|
+
isActive = true
|
|
15
16
|
}) => {
|
|
16
17
|
const {
|
|
17
18
|
applicationType
|
|
@@ -26,7 +27,8 @@ const SearchMessagesResult = /*#__PURE__*/memo(({
|
|
|
26
27
|
refetch
|
|
27
28
|
} = useSearchMessage({
|
|
28
29
|
query: searchTerm,
|
|
29
|
-
applicationType
|
|
30
|
+
applicationType,
|
|
31
|
+
enabled: isActive
|
|
30
32
|
});
|
|
31
33
|
const renderItem = useCallback(({
|
|
32
34
|
item
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["KColors","KContainer","KSpacingValue","memo","useCallback","useSearchMessage","useChatContext","FlatList","StyleSheet","ActivityIndicator","SearchResultItem","SearchConversationTabResultType","SearchEmpty","jsx","_jsx","SearchMessagesResult","searchTerm","onPressItem","applicationType","dataFlatten","hasNextPage","fetchNextPage","isFetchingNextPage","isFetching","isRefetching","refetch","query","renderItem","item","tabResultType","Messages","keyExtractor","conversation","conversationID","chatLog","clientMsgID","onEndReached","View","flex","children","center","color","primary","normal","size","data","contentContainerStyle","styles","container","showsVerticalScrollIndicator","ListEmptyComponent","searchType","refreshing","onRefresh","create","paddingHorizontal"],"sourceRoot":"../../../../src","sources":["screens/SearchConversation/SearchMessagesResult.tsx"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,UAAU,EAAEC,aAAa,QAAQ,eAAe;AAClE,SAASC,IAAI,EAAEC,WAAW,QAAQ,OAAO;AACzC,SAASC,gBAAgB,QAAQ,yCAAsC;AACvE,SAASC,cAAc,QAAQ,wBAAe;AAC9C,SAASC,QAAQ,EAAEC,UAAU,EAAEC,iBAAiB,QAAQ,cAAc;AAEtE,OAAOC,gBAAgB,MAAM,uBAAoB;AACjD,SAASC,+BAA+B,QAAQ,YAAS;AACzD,SAASC,WAAW,QAAQ,kBAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"names":["KColors","KContainer","KSpacingValue","memo","useCallback","useSearchMessage","useChatContext","FlatList","StyleSheet","ActivityIndicator","SearchResultItem","SearchConversationTabResultType","SearchEmpty","jsx","_jsx","SearchMessagesResult","searchTerm","onPressItem","isActive","applicationType","dataFlatten","hasNextPage","fetchNextPage","isFetchingNextPage","isFetching","isRefetching","refetch","query","enabled","renderItem","item","tabResultType","Messages","keyExtractor","conversation","conversationID","chatLog","clientMsgID","onEndReached","View","flex","children","center","color","primary","normal","size","data","contentContainerStyle","styles","container","showsVerticalScrollIndicator","ListEmptyComponent","searchType","refreshing","onRefresh","create","paddingHorizontal"],"sourceRoot":"../../../../src","sources":["screens/SearchConversation/SearchMessagesResult.tsx"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,UAAU,EAAEC,aAAa,QAAQ,eAAe;AAClE,SAASC,IAAI,EAAEC,WAAW,QAAQ,OAAO;AACzC,SAASC,gBAAgB,QAAQ,yCAAsC;AACvE,SAASC,cAAc,QAAQ,wBAAe;AAC9C,SAASC,QAAQ,EAAEC,UAAU,EAAEC,iBAAiB,QAAQ,cAAc;AAEtE,OAAOC,gBAAgB,MAAM,uBAAoB;AACjD,SAASC,+BAA+B,QAAQ,YAAS;AACzD,SAASC,WAAW,QAAQ,kBAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAO5C,MAAMC,oBAAoB,gBAAGZ,IAAI,CAC/B,CAAC;EACCa,UAAU;EACVC,WAAW;EACXC,QAAQ,GAAG;AACe,CAAC,KAAK;EAChC,MAAM;IAAEC;EAAgB,CAAC,GAAGb,cAAc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AElBhC,IAAA,CAACP,QAAQ;MACPwC,IAAI,EAAE3B,WAAY;MAClBS,UAAU,EAAEA,UAAW;MACvBI,YAAY,EAAEA,YAAa;MAC3Be,qBAAqB,EAAEC,MAAM,CAACC,SAAU;MACxCC,4BAA4B,EAAE,KAAM;MACpCb,YAAY,EAAEA,YAAa;MAC3Bc,kBAAkB,eAChBtC,IAAA,CAACF,WAAW;QACVI,UAAU,EAAEA,UAAW;QACvBqC,UAAU,EAAE1C,+BAA+B,CAACqB;MAAS,CACtD,CACF;MACDsB,UAAU,EAAE9B,UAAW;MACvB+B,SAAS,EAAE7B;IAAQ,CACpB;EACF,CACc,CAAC;AAEtB,CACF,CAAC;AAED,eAAeX,oBAAoB;AAEnC,MAAMkC,MAAM,GAAGzC,UAAU,CAACgD,MAAM,CAAC;EAC/BN,SAAS,EAAE;IACTO,iBAAiB,EAAEvD,aAAa,CAAC,SAAS;EAC5C;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -60,33 +60,38 @@ const SearchConversationTabResult = /*#__PURE__*/memo(({
|
|
|
60
60
|
const renderScene = useCallback(({
|
|
61
61
|
route
|
|
62
62
|
}) => {
|
|
63
|
+
const isActive = route.key === routes[index]?.key;
|
|
63
64
|
switch (route.key) {
|
|
64
65
|
case SearchConversationTabResultType.All:
|
|
65
66
|
return /*#__PURE__*/_jsx(SearchAllResult, {
|
|
66
67
|
searchTerm: searchTerm,
|
|
67
68
|
handleChangeTab: handleChangeTab,
|
|
68
69
|
onPressItem: onPressItem,
|
|
69
|
-
onPressSearchContact: onPressSearchContact
|
|
70
|
+
onPressSearchContact: onPressSearchContact,
|
|
71
|
+
isActive: isActive
|
|
70
72
|
});
|
|
71
73
|
case SearchConversationTabResultType.Conversations:
|
|
72
74
|
return /*#__PURE__*/_jsx(SearchContactsResult, {
|
|
73
75
|
searchTerm: searchTerm,
|
|
74
|
-
onPressSearchContact: onPressSearchContact
|
|
76
|
+
onPressSearchContact: onPressSearchContact,
|
|
77
|
+
isActive: isActive
|
|
75
78
|
});
|
|
76
79
|
case SearchConversationTabResultType.Messages:
|
|
77
80
|
return /*#__PURE__*/_jsx(SearchMessagesResult, {
|
|
78
81
|
searchTerm: searchTerm,
|
|
79
|
-
onPressItem: onPressItem
|
|
82
|
+
onPressItem: onPressItem,
|
|
83
|
+
isActive: isActive
|
|
80
84
|
});
|
|
81
85
|
case SearchConversationTabResultType.Community:
|
|
82
86
|
return /*#__PURE__*/_jsx(SearchCommunityResult, {
|
|
83
87
|
searchTerm: searchTerm,
|
|
84
|
-
onPressGroup: onPressGroup
|
|
88
|
+
onPressGroup: onPressGroup,
|
|
89
|
+
isActive: isActive
|
|
85
90
|
});
|
|
86
91
|
default:
|
|
87
92
|
return null;
|
|
88
93
|
}
|
|
89
|
-
}, [searchTerm, handleChangeTab, onPressItem, onPressSearchContact, onPressGroup]);
|
|
94
|
+
}, [searchTerm, handleChangeTab, onPressItem, onPressSearchContact, onPressGroup, index, routes]);
|
|
90
95
|
const renderTabBar = useCallback(() => /*#__PURE__*/_jsx(CustomTabBar, {
|
|
91
96
|
routes: routes,
|
|
92
97
|
index: index,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["KColors","KContainer","KLabel","KRadiusValue","KSpacingValue","memo","useCallback","useState","StyleSheet","TabView","SearchConversationTabResultType","trans","SearchMessagesResult","SearchAllResult","SearchContactsResult","SearchCommunityResult","jsx","_jsx","jsxs","_jsxs","TabRoutes","key","All","title","Conversations","Messages","Community","CustomTabBar","routes","index","onPress","View","style","styles","tabRow","children","map","route","i","isActive","Touchable","tabItem","activeOpacity","Text","typo","color","primary","normal","gray","light","indicator","SearchConversationTabResult","searchTerm","onPressItem","onPressSearchContact","onPressGroup","setIndex","handleChangeTab","findIndex","renderScene","renderTabBar","flex","navigationState","onIndexChange","swipeEnabled","length","lazy","create","flexDirection","borderBottomWidth","borderBottomColor","border","paddingVertical","height","marginHorizontal","justifyContent","alignItems","backgroundColor","width","borderRadius","x","position","bottom","left","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useState","StyleSheet","TabView","SearchConversationTabResultType","trans","SearchMessagesResult","SearchAllResult","SearchContactsResult","SearchCommunityResult","jsx","_jsx","jsxs","_jsxs","TabRoutes","key","All","title","Conversations","Messages","Community","CustomTabBar","routes","index","onPress","View","style","styles","tabRow","children","map","route","i","isActive","Touchable","tabItem","activeOpacity","Text","typo","color","primary","normal","gray","light","indicator","SearchConversationTabResult","searchTerm","onPressItem","onPressSearchContact","onPressGroup","setIndex","handleChangeTab","findIndex","renderScene","renderTabBar","flex","navigationState","onIndexChange","swipeEnabled","length","lazy","create","flexDirection","borderBottomWidth","borderBottomColor","border","paddingVertical","height","marginHorizontal","justifyContent","alignItems","backgroundColor","width","borderRadius","x","position","bottom","left","right"],"sourceRoot":"../../../../src","sources":["screens/SearchConversation/TabResult.tsx"],"mappings":";;AAAA,SACEA,OAAO,EACPC,UAAU,EACVC,MAAM,EACNC,YAAY,EACZC,aAAa,QACR,eAAe;AACtB,SAASC,IAAI,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACnD,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,+BAA+B,QAAQ,YAAS;AACzD,SAASC,KAAK,QAAQ,4BAAmB;AACzC,OAAOC,oBAAoB,MAAM,2BAAwB;AACzD,OAAOC,eAAe,MAAM,sBAAmB;AAC/C,OAAOC,oBAAoB,MAAM,2BAAwB;AACzD,OAAOC,qBAAqB,MAAM,4BAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAY5D,MAAMC,SAAqB,GAAG,CAC5B;EAAEC,GAAG,EAAEX,+BAA+B,CAACY,GAAG;EAAEC,KAAK,EAAEZ,KAAK,CAAC,KAAK;AAAE,CAAC,EACjE;EACEU,GAAG,EAAEX,+BAA+B,CAACc,aAAa;EAClDD,KAAK,EAAEZ,KAAK,CAAC,UAAU;AACzB,CAAC,EACD;EAAEU,GAAG,EAAEX,+BAA+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AY,CAAC6E,CAAC;IAC5BC,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC,CAAC;IACVC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Groups this user deliberately left or dismissed.
|
|
5
|
+
*
|
|
6
|
+
* Leaving fires the same SDK callbacks as being removed by someone else, and
|
|
7
|
+
* the `reason` on ChatEvent.GroupRemoved cannot tell them apart —
|
|
8
|
+
* OnJoinedGroupDeleted reports a self-initiated quit and a kick identically.
|
|
9
|
+
* The access guard needs the distinction: losing access is worth a modal, but
|
|
10
|
+
* walking out is not — the screen that asked for it is already navigating away,
|
|
11
|
+
* so a modal would land on the inbox the user just arrived at.
|
|
12
|
+
*
|
|
13
|
+
* Cleared on rejoin, so a later involuntary removal of the same group is
|
|
14
|
+
* treated as one. Deliberately not time-based: a timer would make correctness
|
|
15
|
+
* depend on how fast the SDK round-trips.
|
|
16
|
+
*/
|
|
17
|
+
const selfExitedGroups = new Set();
|
|
18
|
+
export const markSelfExitedGroup = groupID => {
|
|
19
|
+
if (groupID) selfExitedGroups.add(groupID);
|
|
20
|
+
};
|
|
21
|
+
export const clearSelfExitedGroup = groupID => {
|
|
22
|
+
selfExitedGroups.delete(groupID);
|
|
23
|
+
};
|
|
24
|
+
export const wasSelfExitedGroup = groupID => selfExitedGroups.has(groupID);
|
|
25
|
+
//# sourceMappingURL=groupExit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["selfExitedGroups","Set","markSelfExitedGroup","groupID","add","clearSelfExitedGroup","delete","wasSelfExitedGroup","has"],"sourceRoot":"../../../src","sources":["utils/groupExit.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,gBAAgB,GAAG,IAAIC,GAAG,CAAS,CAAC;AAE1C,OAAO,MAAMC,mBAAmB,GAAIC,OAAe,IAAW;EAC5D,IAAIA,OAAO,EAAEH,gBAAgB,CAACI,GAAG,CAACD,OAAO,CAAC;AAC5C,CAAC;AAED,OAAO,MAAME,oBAAoB,GAAIF,OAAe,IAAW;EAC7DH,gBAAgB,CAACM,MAAM,CAACH,OAAO,CAAC;AAClC,CAAC;AAED,OAAO,MAAMI,kBAAkB,GAAIJ,OAAe,IAChDH,gBAAgB,CAACQ,GAAG,CAACL,OAAO,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChatListener.d.ts","sourceRoot":"","sources":["../../../../src/core/useChatListener.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useChatListener.d.ts","sourceRoot":"","sources":["../../../../src/core/useChatListener.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,eAAe,YAob3B,CAAC"}
|
|
@@ -5,8 +5,9 @@ interface IUseSearchContactsProps {
|
|
|
5
5
|
applicationType: DChatApplicationType;
|
|
6
6
|
type?: ContactCategory;
|
|
7
7
|
pageSize?: number;
|
|
8
|
+
enabled?: boolean;
|
|
8
9
|
}
|
|
9
|
-
export declare const useSearchContacts: ({ query, applicationType, type, pageSize, }: IUseSearchContactsProps) => {
|
|
10
|
+
export declare const useSearchContacts: ({ query, applicationType, type, pageSize, enabled, }: IUseSearchContactsProps) => {
|
|
10
11
|
error: Error;
|
|
11
12
|
isError: true;
|
|
12
13
|
isPending: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearchContacts.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/contacts/useSearchContacts.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAEnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,UAAU,uBAAuB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,oBAAoB,CAAC;IACtC,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,iBAAiB,GAAI,
|
|
1
|
+
{"version":3,"file":"useSearchContacts.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/contacts/useSearchContacts.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAEnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,UAAU,uBAAuB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,oBAAoB,CAAC;IACtC,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,iBAAiB,GAAI,sDAM/B,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDismissGroup.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/groups/useDismissGroup.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDismissGroup.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/groups/useDismissGroup.tsx"],"names":[],"mappings":"AAUA,UAAU,oBAAoB;IAC5B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AACD,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,EAAE,oBAAoB;6BA2C9C,MAAM;EAgC1B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type SearchPublicGroupInfo } from '@droppii/openim-rn-client-sdk';
|
|
2
|
-
export declare const useFetchPublicGroup: (keyword: string) => {
|
|
2
|
+
export declare const useFetchPublicGroup: (keyword: string, enabled?: boolean) => {
|
|
3
3
|
error: Error;
|
|
4
4
|
isError: true;
|
|
5
5
|
isPending: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchPublicGroup.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/groups/useFetchPublicGroup.ts"],"names":[],"mappings":"AAEA,OAAkB,EAEhB,KAAK,qBAAqB,EAC3B,MAAM,+BAA+B,CAAC;AAIvC,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useFetchPublicGroup.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/groups/useFetchPublicGroup.ts"],"names":[],"mappings":"AAEA,OAAkB,EAEhB,KAAK,qBAAqB,EAC3B,MAAM,+BAA+B,CAAC;AAIvC,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,EAAE,iBAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkClE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGroupAccessGuard.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/groups/useGroupAccessGuard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useGroupAccessGuard.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/groups/useGroupAccessGuard.ts"],"names":[],"mappings":"AA2CA,KAAK,MAAM,GAAG;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,wBAAwB,MAAM;;CA0IjE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLeaveGroup.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/groups/useLeaveGroup.tsx"],"names":[],"mappings":"AAAA,OAAkB,EAEhB,eAAe,EAChB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"useLeaveGroup.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/groups/useLeaveGroup.tsx"],"names":[],"mappings":"AAAA,OAAkB,EAEhB,eAAe,EAChB,MAAM,+BAA+B,CAAC;AAwEvC,eAAO,MAAM,aAAa;0BAyBW,MAAM,eAAe,eAAe;;CAoCxE,CAAC"}
|
|
@@ -5,8 +5,9 @@ interface IUseSearchMessageProps {
|
|
|
5
5
|
conversationId?: string;
|
|
6
6
|
applicationType: DChatApplicationType;
|
|
7
7
|
pageSize?: number;
|
|
8
|
+
enabled?: boolean;
|
|
8
9
|
}
|
|
9
|
-
export declare const useSearchMessage: ({ query, conversationId, applicationType, pageSize, }: IUseSearchMessageProps) => {
|
|
10
|
+
export declare const useSearchMessage: ({ query, conversationId, applicationType, pageSize, enabled, }: IUseSearchMessageProps) => {
|
|
10
11
|
error: Error;
|
|
11
12
|
isError: true;
|
|
12
13
|
isPending: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearchMessage.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/message/useSearchMessage.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAEnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAMrD,UAAU,sBAAsB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,oBAAoB,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AACD,eAAO,MAAM,gBAAgB,GAAI,
|
|
1
|
+
{"version":3,"file":"useSearchMessage.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/message/useSearchMessage.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAEnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAMrD,UAAU,sBAAsB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,oBAAoB,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AACD,eAAO,MAAM,gBAAgB,GAAI,gEAM9B,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFxB,CAAC"}
|
|
@@ -5,7 +5,8 @@ interface SearchAllResultProps {
|
|
|
5
5
|
handleChangeTab: (key: SearchConversationTabResultType) => void;
|
|
6
6
|
onPressItem?: (item: ISearchMessageItem) => void;
|
|
7
7
|
onPressSearchContact?: (item: IContactSearchItem) => void;
|
|
8
|
+
isActive?: boolean;
|
|
8
9
|
}
|
|
9
|
-
declare const SearchAllResult: import("react").MemoExoticComponent<({ searchTerm, handleChangeTab, onPressItem, onPressSearchContact, }: SearchAllResultProps) => import("react").JSX.Element>;
|
|
10
|
+
declare const SearchAllResult: import("react").MemoExoticComponent<({ searchTerm, handleChangeTab, onPressItem, onPressSearchContact, isActive, }: SearchAllResultProps) => import("react").JSX.Element>;
|
|
10
11
|
export default SearchAllResult;
|
|
11
12
|
//# sourceMappingURL=SearchAllResult.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchAllResult.d.ts","sourceRoot":"","sources":["../../../../../src/screens/SearchConversation/SearchAllResult.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAO/E,UAAU,oBAAoB;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,CAAC,GAAG,EAAE,+BAA+B,KAAK,IAAI,CAAC;IAChE,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACjD,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchAllResult.d.ts","sourceRoot":"","sources":["../../../../../src/screens/SearchConversation/SearchAllResult.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAO/E,UAAU,oBAAoB;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,CAAC,GAAG,EAAE,+BAA+B,KAAK,IAAI,CAAC;IAChE,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACjD,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAWD,QAAA,MAAM,eAAe,sHAOhB,oBAAoB,iCA+HxB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
interface ISearchCommunityResultProps {
|
|
2
2
|
searchTerm: string;
|
|
3
3
|
onPressGroup?: (groupId: string) => void;
|
|
4
|
+
isActive?: boolean;
|
|
4
5
|
}
|
|
5
|
-
declare const SearchCommunityResult: import("react").MemoExoticComponent<({ searchTerm, onPressGroup }: ISearchCommunityResultProps) => import("react").JSX.Element>;
|
|
6
|
+
declare const SearchCommunityResult: import("react").MemoExoticComponent<({ searchTerm, onPressGroup, isActive, }: ISearchCommunityResultProps) => import("react").JSX.Element>;
|
|
6
7
|
export default SearchCommunityResult;
|
|
7
8
|
//# sourceMappingURL=SearchCommunityResult.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchCommunityResult.d.ts","sourceRoot":"","sources":["../../../../../src/screens/SearchConversation/SearchCommunityResult.tsx"],"names":[],"mappings":"AAUA,UAAU,2BAA2B;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchCommunityResult.d.ts","sourceRoot":"","sources":["../../../../../src/screens/SearchConversation/SearchCommunityResult.tsx"],"names":[],"mappings":"AAUA,UAAU,2BAA2B;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAID,QAAA,MAAM,qBAAqB,gFAKtB,2BAA2B,iCAqE/B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -2,7 +2,8 @@ import { type IContactSearchItem } from '../../types/chat';
|
|
|
2
2
|
interface ISearchContactsResultProps {
|
|
3
3
|
searchTerm: string;
|
|
4
4
|
onPressSearchContact?: (item: IContactSearchItem) => void;
|
|
5
|
+
isActive?: boolean;
|
|
5
6
|
}
|
|
6
|
-
declare const SearchContactsResult: import("react").MemoExoticComponent<({ searchTerm, onPressSearchContact }: ISearchContactsResultProps) => import("react").JSX.Element>;
|
|
7
|
+
declare const SearchContactsResult: import("react").MemoExoticComponent<({ searchTerm, onPressSearchContact, isActive, }: ISearchContactsResultProps) => import("react").JSX.Element>;
|
|
7
8
|
export default SearchContactsResult;
|
|
8
9
|
//# sourceMappingURL=SearchContactsResult.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchContactsResult.d.ts","sourceRoot":"","sources":["../../../../../src/screens/SearchConversation/SearchContactsResult.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAmB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAM5E,UAAU,0BAA0B;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchContactsResult.d.ts","sourceRoot":"","sources":["../../../../../src/screens/SearchConversation/SearchContactsResult.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAmB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAM5E,UAAU,0BAA0B;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAyBD,QAAA,MAAM,oBAAoB,wFAKrB,0BAA0B,iCA8F9B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -2,7 +2,8 @@ import type { ISearchMessageItem } from '../../types/chat';
|
|
|
2
2
|
interface ISearchMessagesResultProps {
|
|
3
3
|
searchTerm: string;
|
|
4
4
|
onPressItem?: (item: ISearchMessageItem) => void;
|
|
5
|
+
isActive?: boolean;
|
|
5
6
|
}
|
|
6
|
-
declare const SearchMessagesResult: import("react").MemoExoticComponent<({ searchTerm, onPressItem }: ISearchMessagesResultProps) => import("react").JSX.Element>;
|
|
7
|
+
declare const SearchMessagesResult: import("react").MemoExoticComponent<({ searchTerm, onPressItem, isActive, }: ISearchMessagesResultProps) => import("react").JSX.Element>;
|
|
7
8
|
export default SearchMessagesResult;
|
|
8
9
|
//# sourceMappingURL=SearchMessagesResult.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchMessagesResult.d.ts","sourceRoot":"","sources":["../../../../../src/screens/SearchConversation/SearchMessagesResult.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAK3D,UAAU,0BAA0B;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchMessagesResult.d.ts","sourceRoot":"","sources":["../../../../../src/screens/SearchConversation/SearchMessagesResult.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAK3D,UAAU,0BAA0B;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AACD,QAAA,MAAM,oBAAoB,+EAKrB,0BAA0B,iCAmE9B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabResult.d.ts","sourceRoot":"","sources":["../../../../../src/screens/SearchConversation/TabResult.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAI/E,UAAU,iCAAiC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACjD,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC1D,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AA6CD,QAAA,MAAM,2BAA2B,yGAM5B,iCAAiC,
|
|
1
|
+
{"version":3,"file":"TabResult.d.ts","sourceRoot":"","sources":["../../../../../src/screens/SearchConversation/TabResult.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAI/E,UAAU,iCAAiC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACjD,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC1D,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AA6CD,QAAA,MAAM,2BAA2B,yGAM5B,iCAAiC,iCAkFrC,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupExit.d.ts","sourceRoot":"","sources":["../../../../src/utils/groupExit.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,KAAG,IAErD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,KAAG,IAEtD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,KAAG,OACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@droppii-org/chat-mobile",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.88",
|
|
4
4
|
"description": "Droppii chat mobile",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"example-legacy": "yarn workspace @droppii-org/chat-mobile-example-legacy"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@droppii/openim-rn-client-sdk": "git+ssh://git@github.com/droppii/open-im-sdk-reactnative.git#v1.0.0-
|
|
72
|
+
"@droppii/openim-rn-client-sdk": "git+ssh://git@github.com/droppii/open-im-sdk-reactnative.git#v1.0.0-rc39",
|
|
73
73
|
"@legendapp/list": "^3.0.6",
|
|
74
74
|
"axios": "^1.16.1",
|
|
75
75
|
"lodash": "^4.18.1",
|
|
@@ -27,6 +27,7 @@ import { markMessageRevoked, useMessageStore } from '../store/message';
|
|
|
27
27
|
import { syncPinnedMessagesOnEvent } from '../hooks/message/usePinMessage';
|
|
28
28
|
import { belongsToConversation } from '../utils/message';
|
|
29
29
|
import { getConversationID } from '../utils/conversation';
|
|
30
|
+
import { clearSelfExitedGroup } from '../utils/groupExit';
|
|
30
31
|
import { DeviceEventEmitter } from 'react-native';
|
|
31
32
|
import { ChatEvent } from '../types/events';
|
|
32
33
|
import { conversationQueryKeys, groupQueryKeys } from '../hooks/query-keys';
|
|
@@ -288,6 +289,9 @@ export const useChatListener = () => {
|
|
|
288
289
|
|
|
289
290
|
const markGroupJoined = useCallback(
|
|
290
291
|
(groupID: string) => {
|
|
292
|
+
// Back in the group: a future removal is no longer the user's own doing.
|
|
293
|
+
clearSelfExitedGroup(groupID);
|
|
294
|
+
|
|
291
295
|
// Mirror of removeGroupConversation: leaving marks the conversation
|
|
292
296
|
// `isNotInGroup`, which keeps it out of the inbox, so rejoining has to
|
|
293
297
|
// clear that flag. This runs on the WS event rather than on joinGroup's
|
|
@@ -17,6 +17,7 @@ interface IUseSearchContactsProps {
|
|
|
17
17
|
applicationType: DChatApplicationType;
|
|
18
18
|
type?: ContactCategory;
|
|
19
19
|
pageSize?: number;
|
|
20
|
+
enabled?: boolean;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export const useSearchContacts = ({
|
|
@@ -24,6 +25,7 @@ export const useSearchContacts = ({
|
|
|
24
25
|
applicationType,
|
|
25
26
|
type,
|
|
26
27
|
pageSize = PAGE_SIZE,
|
|
28
|
+
enabled = true,
|
|
27
29
|
}: IUseSearchContactsProps) => {
|
|
28
30
|
const { data, ...rest } = useInfiniteQuery({
|
|
29
31
|
queryKey: [contactQueryKeys.search(query.trim(), type), pageSize],
|
|
@@ -47,7 +49,7 @@ export const useSearchContacts = ({
|
|
|
47
49
|
return dataLength < pageSize ? undefined : currentPage + 1;
|
|
48
50
|
},
|
|
49
51
|
initialPageParam: 1,
|
|
50
|
-
enabled: !!query.trim() && !!applicationType,
|
|
52
|
+
enabled: enabled && !!query.trim() && !!applicationType,
|
|
51
53
|
});
|
|
52
54
|
|
|
53
55
|
const dataFlatten = useMemo<IContactSearchItem[]>(() => {
|
|
@@ -3,6 +3,10 @@ import OpenIMSDK from '@droppii/openim-rn-client-sdk';
|
|
|
3
3
|
import { KContainer, KLabel } from '@droppii/libs';
|
|
4
4
|
import { UIUtils } from '../../utils/UIUtils';
|
|
5
5
|
import { trans } from '../../translation';
|
|
6
|
+
import {
|
|
7
|
+
clearSelfExitedGroup,
|
|
8
|
+
markSelfExitedGroup,
|
|
9
|
+
} from '../../utils/groupExit';
|
|
6
10
|
|
|
7
11
|
interface UseDismissGroupProps {
|
|
8
12
|
onSuccess?: () => void;
|
|
@@ -59,6 +63,9 @@ export function useDismissGroup({ onSuccess }: UseDismissGroupProps) {
|
|
|
59
63
|
return;
|
|
60
64
|
}
|
|
61
65
|
|
|
66
|
+
// Marked before the call, not after: the SDK can deliver
|
|
67
|
+
// OnGroupDismissed the moment the API returns.
|
|
68
|
+
markSelfExitedGroup(groupID);
|
|
62
69
|
try {
|
|
63
70
|
await OpenIMSDK.dismissGroup(groupID);
|
|
64
71
|
onSuccess?.();
|
|
@@ -67,6 +74,7 @@ export function useDismissGroup({ onSuccess }: UseDismissGroupProps) {
|
|
|
67
74
|
theme: 'light',
|
|
68
75
|
});
|
|
69
76
|
} catch (error) {
|
|
77
|
+
clearSelfExitedGroup(groupID);
|
|
70
78
|
console.error('dismissGroup failed', error);
|
|
71
79
|
UIUtils.toast.open({
|
|
72
80
|
title: trans('chat:generic_error'),
|
|
@@ -7,7 +7,7 @@ import OpenIMSDK, {
|
|
|
7
7
|
import { PAGE_SIZE } from '../../constants';
|
|
8
8
|
import { groupQueryKeys } from '../query-keys';
|
|
9
9
|
|
|
10
|
-
export const useFetchPublicGroup = (keyword: string) => {
|
|
10
|
+
export const useFetchPublicGroup = (keyword: string, enabled = true) => {
|
|
11
11
|
const { data, ...rest } = useInfiniteQuery({
|
|
12
12
|
queryKey: groupQueryKeys.publicSearch(keyword),
|
|
13
13
|
queryFn: ({ pageParam = 0 }) => {
|
|
@@ -24,6 +24,7 @@ export const useFetchPublicGroup = (keyword: string) => {
|
|
|
24
24
|
},
|
|
25
25
|
initialPageParam: 0,
|
|
26
26
|
maxPages: 1,
|
|
27
|
+
enabled,
|
|
27
28
|
});
|
|
28
29
|
|
|
29
30
|
const dataFlatten: SearchPublicGroupInfo[] = useMemo(() => {
|
|
@@ -8,6 +8,7 @@ import { useQueryClient } from '@tanstack/react-query';
|
|
|
8
8
|
import { UIUtils } from '../../utils/UIUtils';
|
|
9
9
|
import { trans } from '../../translation';
|
|
10
10
|
import { ChatEvent, type GroupRemovedPayload } from '../../types/events';
|
|
11
|
+
import { wasSelfExitedGroup } from '../../utils/groupExit';
|
|
11
12
|
import { conversationQueryKeys } from '../query-keys';
|
|
12
13
|
|
|
13
14
|
type GroupAccessState =
|
|
@@ -142,6 +143,11 @@ export const useGroupAccessGuard = ({ groupID, onBlocked }: Params) => {
|
|
|
142
143
|
(payload: GroupRemovedPayload) => {
|
|
143
144
|
if (payload.groupID !== activeGroupId) return;
|
|
144
145
|
|
|
146
|
+
// The user walked out themselves — the screen that asked for it is
|
|
147
|
+
// already navigating away, so a modal here would surface on whatever
|
|
148
|
+
// they landed on.
|
|
149
|
+
if (wasSelfExitedGroup(payload.groupID)) return;
|
|
150
|
+
|
|
145
151
|
// A dismissed group is gone for everyone — no need to re-check.
|
|
146
152
|
if (payload.reason === 'dismissed') {
|
|
147
153
|
block();
|
|
@@ -7,6 +7,10 @@ import { KColors, KContainer, KLabel } from '@droppii/libs';
|
|
|
7
7
|
import { conversationQueryKeys, groupQueryKeys } from '../query-keys';
|
|
8
8
|
import { UIUtils } from '../../utils/UIUtils';
|
|
9
9
|
import { trans } from '../../translation';
|
|
10
|
+
import {
|
|
11
|
+
clearSelfExitedGroup,
|
|
12
|
+
markSelfExitedGroup,
|
|
13
|
+
} from '../../utils/groupExit';
|
|
10
14
|
|
|
11
15
|
const showOwnerBlockedModal = () => {
|
|
12
16
|
UIUtils.alert.open({
|
|
@@ -74,13 +78,19 @@ export const useLeaveGroup = () => {
|
|
|
74
78
|
|
|
75
79
|
const mutation = useMutation({
|
|
76
80
|
mutationKey: groupQueryKeys.leave(),
|
|
77
|
-
mutationFn: (groupID: string) =>
|
|
81
|
+
mutationFn: (groupID: string) => {
|
|
82
|
+
// Marked before the call, not after: the SDK can deliver
|
|
83
|
+
// OnJoinedGroupDeleted the moment the API returns.
|
|
84
|
+
markSelfExitedGroup(groupID);
|
|
85
|
+
return OpenIMSDK.quitGroup(groupID);
|
|
86
|
+
},
|
|
78
87
|
onSuccess: (_data, groupID) => {
|
|
79
88
|
queryClient.invalidateQueries({
|
|
80
89
|
queryKey: conversationQueryKeys.joinedGroup(groupID),
|
|
81
90
|
});
|
|
82
91
|
},
|
|
83
|
-
onError: () => {
|
|
92
|
+
onError: (_error, groupID) => {
|
|
93
|
+
clearSelfExitedGroup(groupID);
|
|
84
94
|
UIUtils.toast.open({
|
|
85
95
|
title: trans('chat:generic_error'),
|
|
86
96
|
theme: 'error',
|
|
@@ -19,12 +19,14 @@ interface IUseSearchMessageProps {
|
|
|
19
19
|
conversationId?: string;
|
|
20
20
|
applicationType: DChatApplicationType;
|
|
21
21
|
pageSize?: number;
|
|
22
|
+
enabled?: boolean;
|
|
22
23
|
}
|
|
23
24
|
export const useSearchMessage = ({
|
|
24
25
|
query,
|
|
25
26
|
conversationId,
|
|
26
27
|
applicationType,
|
|
27
28
|
pageSize = PAGE_SIZE,
|
|
29
|
+
enabled = true,
|
|
28
30
|
}: IUseSearchMessageProps) => {
|
|
29
31
|
const { data, ...rest } = useInfiniteQuery({
|
|
30
32
|
queryKey: [messageQueryKeys.search(query.trim(), conversationId), pageSize],
|
|
@@ -56,7 +58,7 @@ export const useSearchMessage = ({
|
|
|
56
58
|
return dataLength < pageSize ? undefined : currentPage + 1;
|
|
57
59
|
},
|
|
58
60
|
initialPageParam: 1,
|
|
59
|
-
enabled: !!query && !!applicationType,
|
|
61
|
+
enabled: enabled && !!query && !!applicationType,
|
|
60
62
|
});
|
|
61
63
|
|
|
62
64
|
const baseItems = useMemo<ISearchMessageItem[]>(() => {
|
|
@@ -24,12 +24,14 @@ interface SearchAllResultProps {
|
|
|
24
24
|
handleChangeTab: (key: SearchConversationTabResultType) => void;
|
|
25
25
|
onPressItem?: (item: ISearchMessageItem) => void;
|
|
26
26
|
onPressSearchContact?: (item: IContactSearchItem) => void;
|
|
27
|
+
isActive?: boolean;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
interface ISearchAllResultItem {
|
|
30
31
|
type: SearchConversationTabResultType;
|
|
31
32
|
data: (ISearchMessageItem | IContactSearchItem)[];
|
|
32
33
|
title: string;
|
|
34
|
+
hasMore: boolean;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
const PAGE_SIZE = 5;
|
|
@@ -40,18 +42,22 @@ const SearchAllResult = memo(
|
|
|
40
42
|
handleChangeTab,
|
|
41
43
|
onPressItem,
|
|
42
44
|
onPressSearchContact,
|
|
45
|
+
isActive = true,
|
|
43
46
|
}: SearchAllResultProps) => {
|
|
44
47
|
const { applicationType } = useChatContext();
|
|
45
48
|
const { dataFlatten: messagesData, isFetching: isFetchingMessages } =
|
|
46
49
|
useSearchMessage({
|
|
47
50
|
query: searchTerm,
|
|
48
51
|
applicationType,
|
|
49
|
-
pageSize: PAGE_SIZE,
|
|
52
|
+
pageSize: PAGE_SIZE + 1, // Plus 1 to determine if there are more results
|
|
53
|
+
enabled: isActive,
|
|
50
54
|
});
|
|
51
55
|
const { dataFlatten: contactsData, isFetching: isFetchingContacts } =
|
|
52
56
|
useSearchContacts({
|
|
53
57
|
query: searchTerm,
|
|
54
58
|
applicationType,
|
|
59
|
+
pageSize: PAGE_SIZE + 1, // Plus 1 to determine if there are more results
|
|
60
|
+
enabled: isActive,
|
|
55
61
|
});
|
|
56
62
|
const isFetching = isFetchingMessages || isFetchingContacts;
|
|
57
63
|
|
|
@@ -59,13 +65,15 @@ const SearchAllResult = memo(
|
|
|
59
65
|
const mData = [
|
|
60
66
|
{
|
|
61
67
|
type: SearchConversationTabResultType.Conversations,
|
|
62
|
-
data: contactsData,
|
|
68
|
+
data: contactsData.slice(0, PAGE_SIZE),
|
|
63
69
|
title: trans('contacts'),
|
|
70
|
+
hasMore: contactsData.length > PAGE_SIZE,
|
|
64
71
|
},
|
|
65
72
|
{
|
|
66
73
|
type: SearchConversationTabResultType.Messages,
|
|
67
|
-
data: messagesData,
|
|
74
|
+
data: messagesData.slice(0, PAGE_SIZE),
|
|
68
75
|
title: trans('messages'),
|
|
76
|
+
hasMore: messagesData.length > PAGE_SIZE,
|
|
69
77
|
},
|
|
70
78
|
]?.filter((item) => item.data.length > 0);
|
|
71
79
|
return mData;
|
|
@@ -88,10 +96,10 @@ const SearchAllResult = memo(
|
|
|
88
96
|
>
|
|
89
97
|
<KLabel.Text typo="TextMdBold" flex>
|
|
90
98
|
{item.title}
|
|
91
|
-
<KLabel.Text
|
|
99
|
+
{/* <KLabel.Text
|
|
92
100
|
typo="TextNmMedium"
|
|
93
101
|
color={KColors.gray.light}
|
|
94
|
-
>{` (${item.data.length})`}</KLabel.Text>
|
|
102
|
+
>{` (${item.data.length})`}</KLabel.Text> */}
|
|
95
103
|
</KLabel.Text>
|
|
96
104
|
<KImage.VectorIcons name="angle-right-o" size={20} />
|
|
97
105
|
</KContainer.Touchable>
|
|
@@ -113,16 +121,18 @@ const SearchAllResult = memo(
|
|
|
113
121
|
searchTerm={searchTerm}
|
|
114
122
|
/>
|
|
115
123
|
))}
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
<KContainer.VisibleView visible={item.hasMore}>
|
|
125
|
+
<KButton.Link
|
|
126
|
+
label={trans('view_all')}
|
|
127
|
+
icon={{
|
|
128
|
+
vectorName: 'angle-right-o',
|
|
129
|
+
}}
|
|
130
|
+
iconAlignment="right"
|
|
131
|
+
onPress={() => onChangeTab(item.type)}
|
|
132
|
+
size="sm"
|
|
133
|
+
enhanceStyle={styles.viewAllButton}
|
|
134
|
+
/>
|
|
135
|
+
</KContainer.VisibleView>
|
|
126
136
|
</KContainer.View>
|
|
127
137
|
);
|
|
128
138
|
},
|
|
@@ -11,12 +11,17 @@ import { SearchConversationTabResultType } from './types';
|
|
|
11
11
|
interface ISearchCommunityResultProps {
|
|
12
12
|
searchTerm: string;
|
|
13
13
|
onPressGroup?: (groupId: string) => void;
|
|
14
|
+
isActive?: boolean;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
const keyExtractor = (item: SearchPublicGroupInfo) => item.groupID;
|
|
17
18
|
|
|
18
19
|
const SearchCommunityResult = memo(
|
|
19
|
-
({
|
|
20
|
+
({
|
|
21
|
+
searchTerm,
|
|
22
|
+
onPressGroup,
|
|
23
|
+
isActive = true,
|
|
24
|
+
}: ISearchCommunityResultProps) => {
|
|
20
25
|
const hasKeyword = !isEmpty(searchTerm?.trim());
|
|
21
26
|
|
|
22
27
|
const {
|
|
@@ -27,7 +32,7 @@ const SearchCommunityResult = memo(
|
|
|
27
32
|
isFetching,
|
|
28
33
|
isRefetching,
|
|
29
34
|
refetch,
|
|
30
|
-
} = useFetchPublicGroup(searchTerm);
|
|
35
|
+
} = useFetchPublicGroup(searchTerm, isActive);
|
|
31
36
|
|
|
32
37
|
const data = useMemo(
|
|
33
38
|
() => (hasKeyword ? dataFlatten : []),
|