@droppii-org/chat-mobile 0.2.78 → 0.2.79
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 +11 -0
- package/lib/module/core/useChatListener.js.map +1 -1
- package/lib/module/hooks/groups/useGroupAccessGuard.js +145 -0
- package/lib/module/hooks/groups/useGroupAccessGuard.js.map +1 -0
- package/lib/module/screens/ChatInfo/ChatInfoDescriptionRow.js +4 -1
- package/lib/module/screens/ChatInfo/ChatInfoDescriptionRow.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatDetail.js +12 -10
- package/lib/module/screens/chat-detail/ChatDetail.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatDetailHeader.js +3 -9
- package/lib/module/screens/chat-detail/ChatDetailHeader.js.map +1 -1
- package/lib/module/screens/inbox/CommunityTab.js +5 -2
- package/lib/module/screens/inbox/CommunityTab.js.map +1 -1
- package/lib/module/screens/inbox/MessagesTab.js +2 -2
- package/lib/module/screens/inbox/MessagesTab.js.map +1 -1
- package/lib/module/store/conversation.js +18 -20
- package/lib/module/store/conversation.js.map +1 -1
- package/lib/module/translation/resources/i18n.js +4 -1
- package/lib/module/translation/resources/i18n.js.map +1 -1
- package/lib/module/utils/conversation.js +4 -1
- package/lib/module/utils/conversation.js.map +1 -1
- package/lib/module/utils/messageUtils.js +1 -1
- package/lib/module/utils/messageUtils.js.map +1 -1
- package/lib/typescript/src/core/useChatListener.d.ts.map +1 -1
- package/lib/typescript/src/hooks/groups/useGroupAccessGuard.d.ts +10 -0
- package/lib/typescript/src/hooks/groups/useGroupAccessGuard.d.ts.map +1 -0
- package/lib/typescript/src/screens/ChatInfo/ChatInfoDescriptionRow.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/types.d.ts +0 -1
- package/lib/typescript/src/screens/chat-detail/types.d.ts.map +1 -1
- package/lib/typescript/src/store/conversation.d.ts.map +1 -1
- package/lib/typescript/src/translation/resources/i18n.d.ts.map +1 -1
- package/lib/typescript/src/utils/conversation.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/useChatListener.ts +14 -0
- package/src/hooks/groups/useGroupAccessGuard.ts +182 -0
- package/src/screens/ChatInfo/ChatInfoDescriptionRow.tsx +5 -1
- package/src/screens/chat-detail/ChatDetail.tsx +11 -13
- package/src/screens/chat-detail/ChatDetailHeader.tsx +2 -6
- package/src/screens/chat-detail/types.ts +0 -1
- package/src/screens/inbox/CommunityTab.tsx +2 -2
- package/src/screens/inbox/MessagesTab.tsx +1 -1
- package/src/store/conversation.ts +14 -18
- package/src/translation/resources/i18n.ts +4 -0
- package/src/utils/conversation.ts +6 -3
- package/src/utils/messageUtils.ts +1 -1
|
@@ -209,6 +209,10 @@ const i18nKey: Record<string, string> = {
|
|
|
209
209
|
'group:dismiss_confirm_primary': 'Giải tán',
|
|
210
210
|
'group:dismiss_confirm_secondary': 'Quay lại',
|
|
211
211
|
'group:dismiss_toast_success': 'Đã giải tán nhóm',
|
|
212
|
+
'group:access_blocked_title': 'Không thể xem cuộc trò chuyện này',
|
|
213
|
+
'group:access_blocked_desc':
|
|
214
|
+
'Bạn hiện không có quyền truy cập vào cuộc trò chuyện hoặc tin nhắn này.',
|
|
215
|
+
'group:access_blocked_button': 'Đã hiểu',
|
|
212
216
|
};
|
|
213
217
|
|
|
214
218
|
export default {
|
|
@@ -38,9 +38,12 @@ export const getConversationID = (
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
export const sortConversation = (map: Record<string, ConversationItem>) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
// `map` holds every conversation that can still be opened; `list` is the
|
|
42
|
+
// inbox. A group the user is no longer in stays addressable — a public group
|
|
43
|
+
// remains readable via deeplink or search — but must not show in the inbox.
|
|
44
|
+
const list = Object.keys(map)
|
|
45
|
+
.filter((id) => !map[id]?.isNotInGroup)
|
|
46
|
+
.sort((a, b) => conversationCompare(map[a]!, map[b]!));
|
|
44
47
|
return { map, list };
|
|
45
48
|
};
|
|
46
49
|
|
|
@@ -232,7 +232,7 @@ export const getMessagePreview = (message?: MessageItem): string => {
|
|
|
232
232
|
case MessageType.FileMessage: {
|
|
233
233
|
const fileName = message?.fileElem?.fileName;
|
|
234
234
|
if (fileName) {
|
|
235
|
-
return `[File] ${fileName}`;
|
|
235
|
+
return `[File] ${truncateMiddle(fileName, 20)}`;
|
|
236
236
|
}
|
|
237
237
|
return '[File]';
|
|
238
238
|
}
|