@ethora/chat-component-rn 26.10.0 → 26.10.2

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 (79) hide show
  1. package/lib/commonjs/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.js +14 -12
  2. package/lib/commonjs/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.js.map +1 -1
  3. package/lib/commonjs/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.js +41 -39
  4. package/lib/commonjs/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.js.map +1 -1
  5. package/lib/commonjs/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js +137 -50
  6. package/lib/commonjs/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js.map +1 -1
  7. package/lib/commonjs/components/Modals/SettingsModals/ProfileShares/ProfileShares.js +15 -13
  8. package/lib/commonjs/components/Modals/SettingsModals/ProfileShares/ProfileShares.js.map +1 -1
  9. package/lib/commonjs/components/Modals/SettingsModals/Referrals/Referrals.js +57 -55
  10. package/lib/commonjs/components/Modals/SettingsModals/Referrals/Referrals.js.map +1 -1
  11. package/lib/commonjs/components/Modals/SettingsModals/SharedStyledComponents.js +15 -1
  12. package/lib/commonjs/components/Modals/SettingsModals/SharedStyledComponents.js.map +1 -1
  13. package/lib/commonjs/components/Modals/SettingsModals/Visibility/VisibilityModal.js +61 -59
  14. package/lib/commonjs/components/Modals/SettingsModals/Visibility/VisibilityModal.js.map +1 -1
  15. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +8 -3
  16. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  17. package/lib/commonjs/hooks/useLogout.js +15 -10
  18. package/lib/commonjs/hooks/useLogout.js.map +1 -1
  19. package/lib/commonjs/i18n/strings.js +24 -0
  20. package/lib/commonjs/i18n/strings.js.map +1 -1
  21. package/lib/commonjs/networking/api-requests/user.api.js +32 -3
  22. package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
  23. package/lib/commonjs/roomStore/chatSettingsSlice.js +6 -0
  24. package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
  25. package/lib/commonjs/version.js +1 -1
  26. package/lib/module/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.js +15 -13
  27. package/lib/module/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.js.map +1 -1
  28. package/lib/module/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.js +42 -40
  29. package/lib/module/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.js.map +1 -1
  30. package/lib/module/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js +138 -52
  31. package/lib/module/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js.map +1 -1
  32. package/lib/module/components/Modals/SettingsModals/ProfileShares/ProfileShares.js +16 -14
  33. package/lib/module/components/Modals/SettingsModals/ProfileShares/ProfileShares.js.map +1 -1
  34. package/lib/module/components/Modals/SettingsModals/Referrals/Referrals.js +58 -56
  35. package/lib/module/components/Modals/SettingsModals/Referrals/Referrals.js.map +1 -1
  36. package/lib/module/components/Modals/SettingsModals/SharedStyledComponents.js +14 -0
  37. package/lib/module/components/Modals/SettingsModals/SharedStyledComponents.js.map +1 -1
  38. package/lib/module/components/Modals/SettingsModals/Visibility/VisibilityModal.js +62 -60
  39. package/lib/module/components/Modals/SettingsModals/Visibility/VisibilityModal.js.map +1 -1
  40. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +9 -4
  41. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  42. package/lib/module/hooks/useLogout.js +15 -10
  43. package/lib/module/hooks/useLogout.js.map +1 -1
  44. package/lib/module/i18n/strings.js +24 -0
  45. package/lib/module/i18n/strings.js.map +1 -1
  46. package/lib/module/networking/api-requests/user.api.js +31 -3
  47. package/lib/module/networking/api-requests/user.api.js.map +1 -1
  48. package/lib/module/roomStore/chatSettingsSlice.js +6 -0
  49. package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
  50. package/lib/module/version.js +1 -1
  51. package/lib/typescript/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.d.ts.map +1 -1
  52. package/lib/typescript/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.d.ts.map +1 -1
  53. package/lib/typescript/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.d.ts.map +1 -1
  54. package/lib/typescript/components/Modals/SettingsModals/ProfileShares/ProfileShares.d.ts.map +1 -1
  55. package/lib/typescript/components/Modals/SettingsModals/Referrals/Referrals.d.ts.map +1 -1
  56. package/lib/typescript/components/Modals/SettingsModals/SharedStyledComponents.d.ts +1 -0
  57. package/lib/typescript/components/Modals/SettingsModals/SharedStyledComponents.d.ts.map +1 -1
  58. package/lib/typescript/components/Modals/SettingsModals/Visibility/VisibilityModal.d.ts.map +1 -1
  59. package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
  60. package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
  61. package/lib/typescript/i18n/strings.d.ts.map +1 -1
  62. package/lib/typescript/networking/api-requests/user.api.d.ts +8 -0
  63. package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
  64. package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
  65. package/lib/typescript/version.d.ts +1 -1
  66. package/package.json +1 -1
  67. package/src/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.tsx +20 -17
  68. package/src/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.tsx +58 -55
  69. package/src/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.tsx +156 -62
  70. package/src/components/Modals/SettingsModals/ProfileShares/ProfileShares.tsx +22 -19
  71. package/src/components/Modals/SettingsModals/Referrals/Referrals.tsx +48 -45
  72. package/src/components/Modals/SettingsModals/SharedStyledComponents.ts +11 -0
  73. package/src/components/Modals/SettingsModals/Visibility/VisibilityModal.tsx +63 -60
  74. package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +11 -3
  75. package/src/hooks/useLogout.tsx +15 -10
  76. package/src/i18n/strings.ts +24 -0
  77. package/src/networking/api-requests/user.api.ts +28 -2
  78. package/src/roomStore/chatSettingsSlice.ts +6 -0
  79. package/src/version.ts +1 -1
@@ -13,6 +13,7 @@ import {
13
13
  SharedSettingsColumnContainer,
14
14
  SharedSettingsLabelData,
15
15
  SharedSettingsStyledLabel,
16
+ SharedSettingsScrollBody,
16
17
  } from '../SharedStyledComponents';
17
18
  import { RadioInput } from './RadioInput';
18
19
  import { useTheme } from '../../../../hooks/useTheme';
@@ -71,67 +72,69 @@ const VisibilityModal: React.FC<VisibilityModalProps> = ({
71
72
  handleCloseModal={handleCloseModal}
72
73
  headerTitle={t('settings.visibility.title')}
73
74
  />
74
- <SharedSettingsCenterContainer>
75
- <SharedSettingsColumnContainer>
76
- <SharedSettingsStyledLabel>
77
- {t('settings.visibility.profileLabel')}
78
- </SharedSettingsStyledLabel>
79
- <RadioGroup>
80
- <RadioLabel>
81
- <RadioInput
82
- option={{ label: t('settings.visibility.open'), value: isProfileOpen }}
83
- radioColor={theme.primary}
84
- checked={isProfileOpen === true}
85
- onChange={() => setIsProfileOpen(true)}
86
- />
87
- </RadioLabel>
75
+ <SharedSettingsScrollBody>
76
+ <SharedSettingsCenterContainer>
77
+ <SharedSettingsColumnContainer>
78
+ <SharedSettingsStyledLabel>
79
+ {t('settings.visibility.profileLabel')}
80
+ </SharedSettingsStyledLabel>
81
+ <RadioGroup>
82
+ <RadioLabel>
83
+ <RadioInput
84
+ option={{ label: t('settings.visibility.open'), value: isProfileOpen }}
85
+ radioColor={theme.primary}
86
+ checked={isProfileOpen === true}
87
+ onChange={() => setIsProfileOpen(true)}
88
+ />
89
+ </RadioLabel>
88
90
 
89
- <SharedSettingsLabelData>
90
- {t('settings.visibility.openDescription')}
91
- </SharedSettingsLabelData>
92
- <RadioLabel>
93
- <RadioInput
94
- option={{ label: t('settings.visibility.restricted'), value: isProfileOpen }}
95
- radioColor={theme.primary}
96
- checked={isProfileOpen === false}
97
- onChange={() => setIsProfileOpen(false)}
98
- />
99
- </RadioLabel>
100
- <SharedSettingsLabelData>
101
- {t('settings.visibility.restrictedDescription')}
102
- </SharedSettingsLabelData>
103
- </RadioGroup>
104
- </SharedSettingsColumnContainer>
105
- <SharedSettingsColumnContainer>
106
- <SharedSettingsStyledLabel>
107
- {t('settings.visibility.documentsLabel')}
108
- </SharedSettingsStyledLabel>
109
- <RadioGroup>
110
- <RadioLabel>
111
- <RadioInput
112
- option={{ label: t('settings.visibility.full'), value: isAssetsOpen }}
113
- radioColor={theme.primary}
114
- checked={isAssetsOpen === true}
115
- onChange={() => setIsAssetsOpen(true)}
116
- />
117
- </RadioLabel>
118
- <SharedSettingsLabelData>
119
- {t('settings.visibility.fullDescription')}
120
- </SharedSettingsLabelData>
121
- <RadioLabel>
122
- <RadioInput
123
- option={{ label: t('settings.visibility.individual'), value: isAssetsOpen }}
124
- radioColor={theme.primary}
125
- checked={isAssetsOpen === false}
126
- onChange={() => setIsAssetsOpen(false)}
127
- />
128
- </RadioLabel>
129
- <SharedSettingsLabelData>
130
- {t('settings.visibility.individualDescription')}
131
- </SharedSettingsLabelData>
132
- </RadioGroup>
133
- </SharedSettingsColumnContainer>
134
- </SharedSettingsCenterContainer>
91
+ <SharedSettingsLabelData>
92
+ {t('settings.visibility.openDescription')}
93
+ </SharedSettingsLabelData>
94
+ <RadioLabel>
95
+ <RadioInput
96
+ option={{ label: t('settings.visibility.restricted'), value: isProfileOpen }}
97
+ radioColor={theme.primary}
98
+ checked={isProfileOpen === false}
99
+ onChange={() => setIsProfileOpen(false)}
100
+ />
101
+ </RadioLabel>
102
+ <SharedSettingsLabelData>
103
+ {t('settings.visibility.restrictedDescription')}
104
+ </SharedSettingsLabelData>
105
+ </RadioGroup>
106
+ </SharedSettingsColumnContainer>
107
+ <SharedSettingsColumnContainer>
108
+ <SharedSettingsStyledLabel>
109
+ {t('settings.visibility.documentsLabel')}
110
+ </SharedSettingsStyledLabel>
111
+ <RadioGroup>
112
+ <RadioLabel>
113
+ <RadioInput
114
+ option={{ label: t('settings.visibility.full'), value: isAssetsOpen }}
115
+ radioColor={theme.primary}
116
+ checked={isAssetsOpen === true}
117
+ onChange={() => setIsAssetsOpen(true)}
118
+ />
119
+ </RadioLabel>
120
+ <SharedSettingsLabelData>
121
+ {t('settings.visibility.fullDescription')}
122
+ </SharedSettingsLabelData>
123
+ <RadioLabel>
124
+ <RadioInput
125
+ option={{ label: t('settings.visibility.individual'), value: isAssetsOpen }}
126
+ radioColor={theme.primary}
127
+ checked={isAssetsOpen === false}
128
+ onChange={() => setIsAssetsOpen(false)}
129
+ />
130
+ </RadioLabel>
131
+ <SharedSettingsLabelData>
132
+ {t('settings.visibility.individualDescription')}
133
+ </SharedSettingsLabelData>
134
+ </RadioGroup>
135
+ </SharedSettingsColumnContainer>
136
+ </SharedSettingsCenterContainer>
137
+ </SharedSettingsScrollBody>
135
138
 
136
139
  {notification && (
137
140
  <Notification type={notification.type}>
@@ -3,6 +3,7 @@
3
3
  import React, { useCallback, useMemo } from 'react';
4
4
  import LanguageCard from './LanguageCard';
5
5
  import {
6
+ ScrollView,
6
7
  StyleSheet,
7
8
  Switch,
8
9
  Text,
@@ -119,7 +120,11 @@ const UserSettingsModal: React.FC<UserSettingsModalProps> = ({
119
120
  {/* One card per entry, rather than a single bordered block with
120
121
  * hairline dividers — the rows are separate destinations, and the
121
122
  * design gives each its own surface. */}
122
- <View style={styles.body}>
123
+ <ScrollView
124
+ style={styles.scroll}
125
+ contentContainerStyle={styles.body}
126
+ showsVerticalScrollIndicator={false}
127
+ >
123
128
  {!config?.settings?.hideAppearance ? (
124
129
  <View style={[styles.card, styles.stackCard]} testID="settings-appearance">
125
130
  <Text style={styles.label}>{t('settings.appearance.title')}</Text>
@@ -188,7 +193,7 @@ const UserSettingsModal: React.FC<UserSettingsModalProps> = ({
188
193
  />
189
194
  </TouchableOpacity>
190
195
  ))}
191
- </View>
196
+ </ScrollView>
192
197
  </ModalContainerFullScreen>
193
198
  );
194
199
  };
@@ -197,8 +202,11 @@ const createStyles = (theme: ChatTheme) => StyleSheet.create({
197
202
  screen: {
198
203
  backgroundColor: theme.listBackground,
199
204
  },
200
- body: {
205
+ scroll: {
206
+ flex: 1,
201
207
  width: '100%',
208
+ },
209
+ body: {
202
210
  padding: 12,
203
211
  gap: 12,
204
212
  },
@@ -50,7 +50,18 @@ const logoutService = {
50
50
  * AFTER all the disk work has actually landed.
51
51
  */
52
52
  performLogout: async (): Promise<void> => {
53
- // 0. Flush lastViewedTimestamp to the server's private store BEFORE
53
+ // 0. Push. Release the device-token registration on the backend
54
+ // FIRST, while the access token is still valid (the token itself
55
+ // is kept so the next login re-registers it). It runs alongside
56
+ // the private-store flush below instead of after it: the flush
57
+ // can take up to 2s, and a host with a logout time budget could
58
+ // cut us off before the release went out, leaving the device
59
+ // receiving pushes for the logged-out user.
60
+ const pushRelease = releasePushRegistration().catch((e) => {
61
+ console.warn('logoutService: push release failed', e);
62
+ });
63
+
64
+ // 0a. Flush lastViewedTimestamp to the server's private store BEFORE
54
65
  // we close XMPP. Only rooms with no outstanding unread (plus the
55
66
  // visible room) get their entries updated — rooms with unread
56
67
  // keep their old marker so the next login still surfaces those
@@ -95,15 +106,9 @@ const logoutService = {
95
106
  /* non-fatal */
96
107
  }
97
108
 
98
- // 2. Push. Release the device-token registration on the backend
99
- // while the access token is still valid (the token itself is kept
100
- // so the next login re-registers it), then clear the local MucSub
101
- // room cache.
102
- try {
103
- await releasePushRegistration();
104
- } catch (e) {
105
- console.warn('logoutService: push release failed', e);
106
- }
109
+ // 2. Push. Wait for the release started in step 0, then clear the
110
+ // local MucSub room cache.
111
+ await pushRelease;
107
112
  try {
108
113
  await pushSubscriptionService.reset();
109
114
  } catch (e) {
@@ -343,6 +343,10 @@ const en: UiStringTable = {
343
343
  'settings.manageData.deleteLabel': 'Delete your account',
344
344
  'settings.manageData.deleteDescription': 'Use this only if you want to permanently delete your account & data from our system.',
345
345
  'settings.manageData.deleteDisclosure': 'Due to the immutable nature of distributed ledger technology, network nodes operated by the community may still retain historical transactions generated by your account, however your personally identifiable information such as your name, e-mail, your key-value storage etc will be removed. Any of your digital assets will be lost.',
346
+ 'settings.manageData.downloadFailed': "Couldn't download your data. Please try again later.",
347
+ 'settings.manageData.deleteConfirmTitle': 'Delete your account?',
348
+ 'settings.manageData.deleteConfirmMessage': 'This permanently deletes your account and data. It cannot be undone.',
349
+ 'settings.manageData.deleteFailed': "Couldn't delete your account. Please try again later.",
346
350
  'search.messages.title': 'Search messages',
347
351
  'search.messages.placeholderChat': 'Search in this chat',
348
352
  'search.messages.placeholderAll': 'Search all chats',
@@ -716,6 +720,10 @@ const fr: UiStringTable = {
716
720
  'settings.manageData.deleteLabel': 'Supprimer votre compte',
717
721
  'settings.manageData.deleteDescription': 'À utiliser uniquement si vous souhaitez supprimer définitivement votre compte et vos données de notre système.',
718
722
  'settings.manageData.deleteDisclosure': "En raison de la nature immuable de la technologie des registres distribués, les nœuds du réseau exploités par la communauté peuvent conserver des transactions historiques générées par votre compte ; toutefois, vos informations personnelles identifiables telles que votre nom, e-mail, stockage clé-valeur, etc. seront supprimées. Tous vos actifs numériques seront perdus.",
723
+ 'settings.manageData.downloadFailed': 'Impossible de télécharger vos données. Veuillez réessayer plus tard.',
724
+ 'settings.manageData.deleteConfirmTitle': 'Supprimer votre compte ?',
725
+ 'settings.manageData.deleteConfirmMessage': 'Votre compte et vos données seront définitivement supprimés. Cette action est irréversible.',
726
+ 'settings.manageData.deleteFailed': 'Impossible de supprimer votre compte. Veuillez réessayer plus tard.',
719
727
  'search.messages.title': 'Rechercher des messages',
720
728
  'search.messages.placeholderChat': 'Rechercher dans cette discussion',
721
729
  'search.messages.placeholderAll': 'Rechercher dans toutes les discussions',
@@ -1089,6 +1097,10 @@ const es: UiStringTable = {
1089
1097
  'settings.manageData.deleteLabel': 'Elimina tu cuenta',
1090
1098
  'settings.manageData.deleteDescription': 'Utiliza esto solo si deseas eliminar permanentemente tu cuenta y tus datos de nuestro sistema.',
1091
1099
  'settings.manageData.deleteDisclosure': 'Debido a la naturaleza inmutable de la tecnología de registro distribuido, los nodos de red operados por la comunidad pueden seguir conservando transacciones históricas generadas por tu cuenta; sin embargo, tu información personal identificable, como tu nombre, correo electrónico y almacenamiento clave-valor, será eliminada. Se perderán todos tus activos digitales.',
1100
+ 'settings.manageData.downloadFailed': 'No se pudieron descargar tus datos. Inténtalo de nuevo más tarde.',
1101
+ 'settings.manageData.deleteConfirmTitle': '¿Eliminar tu cuenta?',
1102
+ 'settings.manageData.deleteConfirmMessage': 'Tu cuenta y tus datos se eliminarán de forma permanente. No se puede deshacer.',
1103
+ 'settings.manageData.deleteFailed': 'No se pudo eliminar tu cuenta. Inténtalo de nuevo más tarde.',
1092
1104
  'search.messages.title': 'Buscar mensajes',
1093
1105
  'search.messages.placeholderChat': 'Buscar en este chat',
1094
1106
  'search.messages.placeholderAll': 'Buscar en todos los chats',
@@ -1462,6 +1474,10 @@ const pt: UiStringTable = {
1462
1474
  'settings.manageData.deleteLabel': 'Eliminar a sua conta',
1463
1475
  'settings.manageData.deleteDescription': 'Use isto apenas se quiser eliminar permanentemente a sua conta e os seus dados do nosso sistema.',
1464
1476
  'settings.manageData.deleteDisclosure': 'Devido à natureza imutável da tecnologia de registo distribuído, os nós da rede operados pela comunidade podem manter transações históricas geradas pela sua conta; no entanto, as suas informações de identificação pessoal, como nome, email e armazenamento chave-valor, serão removidas. Todos os seus ativos digitais serão perdidos.',
1477
+ 'settings.manageData.downloadFailed': 'Não foi possível transferir os seus dados. Tente novamente mais tarde.',
1478
+ 'settings.manageData.deleteConfirmTitle': 'Eliminar a sua conta?',
1479
+ 'settings.manageData.deleteConfirmMessage': 'A sua conta e os seus dados serão eliminados permanentemente. Não é possível anular.',
1480
+ 'settings.manageData.deleteFailed': 'Não foi possível eliminar a sua conta. Tente novamente mais tarde.',
1465
1481
  'search.messages.title': 'Pesquisar mensagens',
1466
1482
  'search.messages.placeholderChat': 'Pesquisar nesta conversa',
1467
1483
  'search.messages.placeholderAll': 'Pesquisar em todas as conversas',
@@ -1835,6 +1851,10 @@ const ht: UiStringTable = {
1835
1851
  'settings.manageData.deleteLabel': 'Efase kont ou',
1836
1852
  'settings.manageData.deleteDescription': 'Sèvi ak sa a sèlman si ou vle efase kont ou ak done ou yo nèt nan sistèm nou an.',
1837
1853
  'settings.manageData.deleteDisclosure': 'Akoz nati imityab teknoloji rejis distribiye a, nœud rezo kominote a opere yo ka toujou kenbe tranzaksyon istorik kont ou an te jenere; sepandan, enfòmasyon idantifyab pèsonèl ou yo tankou non ou, imèl ou ak depo kle-valè ou yo ap retire. Tout byen dijital ou yo ap pèdi.',
1854
+ 'settings.manageData.downloadFailed': 'Nou pa t ka telechaje done ou yo. Tanpri eseye ankò pita.',
1855
+ 'settings.manageData.deleteConfirmTitle': 'Efase kont ou?',
1856
+ 'settings.manageData.deleteConfirmMessage': 'Sa ap efase kont ou ak done ou yo nèt. Ou pa ka defèt sa.',
1857
+ 'settings.manageData.deleteFailed': 'Nou pa t ka efase kont ou. Tanpri eseye ankò pita.',
1838
1858
  'search.messages.title': 'Chèche mesaj',
1839
1859
  'search.messages.placeholderChat': 'Chèche nan chat sa a',
1840
1860
  'search.messages.placeholderAll': 'Chèche nan tout chat yo',
@@ -2208,6 +2228,10 @@ const zh: UiStringTable = {
2208
2228
  'settings.manageData.deleteLabel': '删除您的账户',
2209
2229
  'settings.manageData.deleteDescription': '仅当您希望从我们的系统中永久删除您的账户及数据时才使用此功能。',
2210
2230
  'settings.manageData.deleteDisclosure': '由于分布式账本技术的不可篡改特性,社区运营的网络节点可能仍会保留您账户生成的历史交易记录;但您的个人身份信息,如姓名、电子邮箱、键值存储等将被移除。您的所有数字资产都将丢失。',
2231
+ 'settings.manageData.downloadFailed': '无法下载您的数据,请稍后重试。',
2232
+ 'settings.manageData.deleteConfirmTitle': '删除您的账户?',
2233
+ 'settings.manageData.deleteConfirmMessage': '这将永久删除您的账户和数据,且无法撤销。',
2234
+ 'settings.manageData.deleteFailed': '无法删除您的账户,请稍后重试。',
2211
2235
  'search.messages.title': '搜索消息',
2212
2236
  'search.messages.placeholderChat': '在此聊天中搜索',
2213
2237
  'search.messages.placeholderAll': '在所有聊天中搜索',
@@ -1,3 +1,4 @@
1
+ import * as FileSystem from 'expo-file-system/legacy';
1
2
  import http from '../apiClient';
2
3
  import { normalizeApiPath } from '../apiClient';
3
4
  import { store } from '../../roomStore';
@@ -37,11 +38,31 @@ export function getExportMyData() {
37
38
  return http.get('/v1/users/exportData', {
38
39
  headers: {
39
40
  Authorization: token,
40
- responseType: 'arraybuffer',
41
41
  },
42
+ responseType: 'arraybuffer',
42
43
  });
43
44
  }
44
45
 
46
+ /**
47
+ * Download the current user's data export (`GET /v1/users/exportData`)
48
+ * straight to `destPath` on disk. The export can be large, so it is
49
+ * streamed by expo-file-system instead of being buffered through axios.
50
+ * Rejects on a non-2xx answer so the caller can show an error.
51
+ */
52
+ export async function downloadMyDataExport(destPath: string) {
53
+ const token = store.getState().chatSettingStore.user.token || '';
54
+ const result = await FileSystem.downloadAsync(
55
+ `${http.defaults.baseURL || ''}/v1/users/exportData`,
56
+ destPath,
57
+ { headers: { Authorization: token } }
58
+ );
59
+ if (result.status < 200 || result.status >= 300) {
60
+ await FileSystem.deleteAsync(result.uri, { idempotent: true });
61
+ throw new Error(`exportData failed with status ${result.status}`);
62
+ }
63
+ return result;
64
+ }
65
+
45
66
  export function deleteDocument(fileId: string) {
46
67
  const token = store.getState().chatSettingStore.user.token || '';
47
68
  return http.delete(`/v1/files/${fileId}`, {
@@ -52,7 +73,12 @@ export function deleteDocument(fileId: string) {
52
73
  }
53
74
 
54
75
  export function deleteMe() {
55
- return http.delete('/v1/users');
76
+ const token = store.getState().chatSettingStore.user.token || '';
77
+ return http.delete('/v1/users', {
78
+ headers: {
79
+ Authorization: token,
80
+ },
81
+ });
56
82
  }
57
83
 
58
84
  export function updateMe(data: any) {
@@ -231,6 +231,12 @@ const reducers = {
231
231
  state.client = undefined;
232
232
  state.langSource = undefined;
233
233
  state.translateMode = undefined;
234
+ // Drop any open modal / preview so the next login lands on the chat
235
+ // list instead of the screen the previous session was on.
236
+ state.activeModal = undefined;
237
+ state.deleteModal = undefined;
238
+ state.selectedUser = undefined;
239
+ state.activeFile = undefined;
234
240
  secureUserStorage().remove();
235
241
  },
236
242
  setLangSource: (
package/src/version.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  // Generated by scripts/sync-version.mjs on `npm version`.
2
2
  // Edit package.json's version instead of this file.
3
- export const ETHORA_CHAT_COMPONENT_VERSION = '26.10.0';
3
+ export const ETHORA_CHAT_COMPONENT_VERSION = '26.10.2';