@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.
Files changed (47) hide show
  1. package/lib/module/core/useChatListener.js +11 -0
  2. package/lib/module/core/useChatListener.js.map +1 -1
  3. package/lib/module/hooks/groups/useGroupAccessGuard.js +145 -0
  4. package/lib/module/hooks/groups/useGroupAccessGuard.js.map +1 -0
  5. package/lib/module/screens/ChatInfo/ChatInfoDescriptionRow.js +4 -1
  6. package/lib/module/screens/ChatInfo/ChatInfoDescriptionRow.js.map +1 -1
  7. package/lib/module/screens/chat-detail/ChatDetail.js +12 -10
  8. package/lib/module/screens/chat-detail/ChatDetail.js.map +1 -1
  9. package/lib/module/screens/chat-detail/ChatDetailHeader.js +3 -9
  10. package/lib/module/screens/chat-detail/ChatDetailHeader.js.map +1 -1
  11. package/lib/module/screens/inbox/CommunityTab.js +5 -2
  12. package/lib/module/screens/inbox/CommunityTab.js.map +1 -1
  13. package/lib/module/screens/inbox/MessagesTab.js +2 -2
  14. package/lib/module/screens/inbox/MessagesTab.js.map +1 -1
  15. package/lib/module/store/conversation.js +18 -20
  16. package/lib/module/store/conversation.js.map +1 -1
  17. package/lib/module/translation/resources/i18n.js +4 -1
  18. package/lib/module/translation/resources/i18n.js.map +1 -1
  19. package/lib/module/utils/conversation.js +4 -1
  20. package/lib/module/utils/conversation.js.map +1 -1
  21. package/lib/module/utils/messageUtils.js +1 -1
  22. package/lib/module/utils/messageUtils.js.map +1 -1
  23. package/lib/typescript/src/core/useChatListener.d.ts.map +1 -1
  24. package/lib/typescript/src/hooks/groups/useGroupAccessGuard.d.ts +10 -0
  25. package/lib/typescript/src/hooks/groups/useGroupAccessGuard.d.ts.map +1 -0
  26. package/lib/typescript/src/screens/ChatInfo/ChatInfoDescriptionRow.d.ts.map +1 -1
  27. package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts.map +1 -1
  28. package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts +1 -1
  29. package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts.map +1 -1
  30. package/lib/typescript/src/screens/chat-detail/types.d.ts +0 -1
  31. package/lib/typescript/src/screens/chat-detail/types.d.ts.map +1 -1
  32. package/lib/typescript/src/store/conversation.d.ts.map +1 -1
  33. package/lib/typescript/src/translation/resources/i18n.d.ts.map +1 -1
  34. package/lib/typescript/src/utils/conversation.d.ts.map +1 -1
  35. package/package.json +1 -1
  36. package/src/core/useChatListener.ts +14 -0
  37. package/src/hooks/groups/useGroupAccessGuard.ts +182 -0
  38. package/src/screens/ChatInfo/ChatInfoDescriptionRow.tsx +5 -1
  39. package/src/screens/chat-detail/ChatDetail.tsx +11 -13
  40. package/src/screens/chat-detail/ChatDetailHeader.tsx +2 -6
  41. package/src/screens/chat-detail/types.ts +0 -1
  42. package/src/screens/inbox/CommunityTab.tsx +2 -2
  43. package/src/screens/inbox/MessagesTab.tsx +1 -1
  44. package/src/store/conversation.ts +14 -18
  45. package/src/translation/resources/i18n.ts +4 -0
  46. package/src/utils/conversation.ts +6 -3
  47. 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
- const list = Object.keys(map).sort((a, b) =>
42
- conversationCompare(map[a]!, map[b]!)
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
  }