stream-chat-react-native-core 5.27.0-beta.11 → 5.27.0-beta.12
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/commonjs/components/Chat/hooks/handleEventToSyncDB.js +100 -37
- package/lib/commonjs/components/Chat/hooks/handleEventToSyncDB.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useSyncDatabase.js +3 -1
- package/lib/commonjs/components/Chat/hooks/useSyncDatabase.js.map +1 -1
- package/lib/commonjs/i18n/en.json +1 -1
- package/lib/commonjs/i18n/es.json +43 -43
- package/lib/commonjs/i18n/fr.json +43 -43
- package/lib/commonjs/i18n/he.json +43 -43
- package/lib/commonjs/i18n/hi.json +43 -43
- package/lib/commonjs/i18n/it.json +43 -43
- package/lib/commonjs/i18n/ja.json +42 -42
- package/lib/commonjs/i18n/ko.json +42 -42
- package/lib/commonjs/i18n/nl.json +42 -42
- package/lib/commonjs/i18n/pt-BR.json +42 -42
- package/lib/commonjs/i18n/ru.json +42 -42
- package/lib/commonjs/i18n/tr.json +42 -42
- package/lib/commonjs/store/apis/upsertChannelDataFromChannel.js +21 -0
- package/lib/commonjs/store/apis/upsertChannelDataFromChannel.js.map +1 -0
- package/lib/commonjs/store/mappers/mapChannelToStorable.js +63 -0
- package/lib/commonjs/store/mappers/mapChannelToStorable.js.map +1 -0
- package/lib/commonjs/utils/DBSyncManager.js +73 -68
- package/lib/commonjs/utils/DBSyncManager.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Chat/hooks/handleEventToSyncDB.js +100 -37
- package/lib/module/components/Chat/hooks/handleEventToSyncDB.js.map +1 -1
- package/lib/module/components/Chat/hooks/useSyncDatabase.js +3 -1
- package/lib/module/components/Chat/hooks/useSyncDatabase.js.map +1 -1
- package/lib/module/i18n/en.json +1 -1
- package/lib/module/i18n/es.json +43 -43
- package/lib/module/i18n/fr.json +43 -43
- package/lib/module/i18n/he.json +43 -43
- package/lib/module/i18n/hi.json +43 -43
- package/lib/module/i18n/it.json +43 -43
- package/lib/module/i18n/ja.json +42 -42
- package/lib/module/i18n/ko.json +42 -42
- package/lib/module/i18n/nl.json +42 -42
- package/lib/module/i18n/pt-BR.json +42 -42
- package/lib/module/i18n/ru.json +42 -42
- package/lib/module/i18n/tr.json +42 -42
- package/lib/module/store/apis/upsertChannelDataFromChannel.js +21 -0
- package/lib/module/store/apis/upsertChannelDataFromChannel.js.map +1 -0
- package/lib/module/store/mappers/mapChannelToStorable.js +63 -0
- package/lib/module/store/mappers/mapChannelToStorable.js.map +1 -0
- package/lib/module/utils/DBSyncManager.js +73 -68
- package/lib/module/utils/DBSyncManager.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Chat/hooks/handleEventToSyncDB.d.ts +4 -2
- package/lib/typescript/i18n/en.json +1 -1
- package/lib/typescript/i18n/es.json +43 -43
- package/lib/typescript/i18n/fr.json +43 -43
- package/lib/typescript/i18n/he.json +43 -43
- package/lib/typescript/i18n/hi.json +43 -43
- package/lib/typescript/i18n/it.json +43 -43
- package/lib/typescript/i18n/ja.json +42 -42
- package/lib/typescript/i18n/ko.json +42 -42
- package/lib/typescript/i18n/nl.json +42 -42
- package/lib/typescript/i18n/pt-BR.json +42 -42
- package/lib/typescript/i18n/ru.json +42 -42
- package/lib/typescript/i18n/tr.json +42 -42
- package/lib/typescript/store/apis/upsertChannelDataFromChannel.d.ts +6 -0
- package/lib/typescript/store/mappers/mapChannelToStorable.d.ts +4 -0
- package/lib/typescript/utils/DBSyncManager.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Chat/hooks/handleEventToSyncDB.ts +132 -46
- package/src/components/Chat/hooks/useSyncDatabase.ts +1 -1
- package/src/i18n/en.json +1 -1
- package/src/i18n/es.json +43 -43
- package/src/i18n/fr.json +43 -43
- package/src/i18n/he.json +43 -43
- package/src/i18n/hi.json +43 -43
- package/src/i18n/it.json +43 -43
- package/src/i18n/ja.json +42 -42
- package/src/i18n/ko.json +42 -42
- package/src/i18n/nl.json +42 -42
- package/src/i18n/pt-BR.json +42 -42
- package/src/i18n/ru.json +42 -42
- package/src/i18n/tr.json +42 -42
- package/src/store/apis/upsertChannelDataFromChannel.ts +25 -0
- package/src/store/mappers/mapChannelToStorable.ts +68 -0
- package/src/utils/DBSyncManager.ts +7 -3
- package/src/version.json +1 -1
package/src/i18n/ru.json
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
{
|
|
2
2
|
"1 Reply": "1 Ответ",
|
|
3
|
-
"1 Thread Reply": "
|
|
3
|
+
"1 Thread Reply": "",
|
|
4
4
|
"Allow access to your Gallery": "",
|
|
5
5
|
"Allow camera access in device settings": "",
|
|
6
6
|
"Also send to channel": "",
|
|
7
|
-
"Are you sure you want to permanently delete this message?": "",
|
|
8
|
-
"Are you sure?": "
|
|
9
|
-
"Block User": "",
|
|
10
|
-
"Cancel": "",
|
|
11
|
-
"Cannot Flag Message": "",
|
|
12
|
-
"Consider how your comment might make others feel and be sure to follow our Community Guidelines": "
|
|
13
|
-
"Copy Message": "",
|
|
14
|
-
"Delete": "",
|
|
15
|
-
"Delete Message": "",
|
|
7
|
+
"Are you sure you want to permanently delete this message?": "Вы действительно хотите удалить это сообщение без возможности восстановления?",
|
|
8
|
+
"Are you sure?": "",
|
|
9
|
+
"Block User": "Заблокировать пользователя",
|
|
10
|
+
"Cancel": "Отмена",
|
|
11
|
+
"Cannot Flag Message": "Невозможно пожаловаться на сообщение",
|
|
12
|
+
"Consider how your comment might make others feel and be sure to follow our Community Guidelines": "",
|
|
13
|
+
"Copy Message": "Копировать сообщение",
|
|
14
|
+
"Delete": "удалять",
|
|
15
|
+
"Delete Message": "Удалить сообщение",
|
|
16
16
|
"Device camera is used to take photos or videos.": "",
|
|
17
|
-
"Do you want to send a copy of this message to a moderator for further investigation?": "",
|
|
18
|
-
"Edit Message": "",
|
|
19
|
-
"Editing Message": "
|
|
20
|
-
"Emoji matching": "
|
|
17
|
+
"Do you want to send a copy of this message to a moderator for further investigation?": "Вы хотите отправить копию этого сообщения модератору для дальнейшего изучения?",
|
|
18
|
+
"Edit Message": "Редактировать сообщение",
|
|
19
|
+
"Editing Message": "",
|
|
20
|
+
"Emoji matching": "",
|
|
21
21
|
"Empty message...": "Пустое сообщение...",
|
|
22
|
-
"Error loading": "
|
|
22
|
+
"Error loading": "",
|
|
23
23
|
"Error loading channel list...": "Ошибка загрузки списка каналов...",
|
|
24
24
|
"Error loading messages for this channel...": "Ошибка загрузки сообщений для этого канала...",
|
|
25
25
|
"Error while loading, please reload/refresh": "Ошибка загрузки, пожалуйста перезагрузите или обновите",
|
|
26
26
|
"File type not supported": "",
|
|
27
|
-
"Flag": "",
|
|
28
|
-
"Flag Message": "",
|
|
29
|
-
"Flag action failed either due to a network issue or the message is already flagged": "",
|
|
27
|
+
"Flag": "Пометить",
|
|
28
|
+
"Flag Message": "Пометить сообщение",
|
|
29
|
+
"Flag action failed either due to a network issue or the message is already flagged": "Не удалось отправить жалобу. Возможные причины: проблема с подключением к интернету или ваша жалоба уже была принята.",
|
|
30
30
|
"How about sending your first message to a friend?": "Как насчет отправки первого сообщения другу?",
|
|
31
|
-
"Instant Commands": "
|
|
31
|
+
"Instant Commands": "",
|
|
32
32
|
"Let's start chatting!": "Давайте начнем общаться!",
|
|
33
33
|
"Links are disabled": "Ссылки отключены",
|
|
34
|
-
"Loading channels...": "",
|
|
35
|
-
"Loading messages...": "",
|
|
36
|
-
"Loading...": "",
|
|
34
|
+
"Loading channels...": "Загружаю каналы...",
|
|
35
|
+
"Loading messages...": "Загружаю сообщения...",
|
|
36
|
+
"Loading...": "Загружаю...",
|
|
37
37
|
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Достигнут предел максимального размера файла для загрузки. Загрузите файл размером менее {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} МБ.",
|
|
38
|
-
"Message Reactions": "",
|
|
38
|
+
"Message Reactions": "Сообщения Реакции",
|
|
39
39
|
"Message deleted": "Сообщение удалено",
|
|
40
|
-
"Message flagged": "",
|
|
41
|
-
"Mute User": "",
|
|
40
|
+
"Message flagged": "Сообщение отмечено",
|
|
41
|
+
"Mute User": "Отключить пользователя",
|
|
42
42
|
"Not supported": "",
|
|
43
43
|
"Nothing yet...": "Пока ничего нет...",
|
|
44
|
-
"Ok": "",
|
|
45
|
-
"Only visible to you": "
|
|
44
|
+
"Ok": "Oк",
|
|
45
|
+
"Only visible to you": "",
|
|
46
46
|
"Open Settings": "",
|
|
47
47
|
"Photo": "Фото",
|
|
48
48
|
"Photos and Videos": "",
|
|
49
|
-
"Pin to Conversation": "",
|
|
49
|
+
"Pin to Conversation": "Закрепить к беседе",
|
|
50
50
|
"Pinned by": "",
|
|
51
51
|
"Please enable access to your photos and videos so you can share them.": "",
|
|
52
|
-
"Please select a channel first": "",
|
|
52
|
+
"Please select a channel first": "Пожалуйста, сначала выберите канал",
|
|
53
53
|
"Reconnecting...": "Переподключение...",
|
|
54
|
-
"Reply": "",
|
|
54
|
+
"Reply": "Ответить",
|
|
55
55
|
"Reply to Message": "",
|
|
56
|
-
"Resend": "",
|
|
57
|
-
"Search GIFs": "",
|
|
56
|
+
"Resend": "Отправить",
|
|
57
|
+
"Search GIFs": "Поиск GIF",
|
|
58
58
|
"Select More Photos": "",
|
|
59
|
-
"Send Anyway": "
|
|
60
|
-
"Send a message": "",
|
|
59
|
+
"Send Anyway": "",
|
|
60
|
+
"Send a message": "Отправить сообщение",
|
|
61
61
|
"Sending links is not allowed in this conversation": "Отправка ссылок недоступна в этом чате",
|
|
62
|
-
"Slow mode ON": "",
|
|
63
|
-
"The message has been reported to a moderator.": "",
|
|
64
|
-
"Thread Reply": "",
|
|
65
|
-
"Unblock User": "",
|
|
62
|
+
"Slow mode ON": "Медленный режим включен",
|
|
63
|
+
"The message has been reported to a moderator.": "Сообщение отправлено модератору.",
|
|
64
|
+
"Thread Reply": "Тема Ответить",
|
|
65
|
+
"Unblock User": "Разблокировать пользователя",
|
|
66
66
|
"Unknown User": "",
|
|
67
|
-
"Unmute User": "",
|
|
68
|
-
"Unpin from Conversation": "",
|
|
69
|
-
"Unread Messages": "",
|
|
67
|
+
"Unmute User": "Включить микрофон",
|
|
68
|
+
"Unpin from Conversation": "Открепить от беседы",
|
|
69
|
+
"Unread Messages": "Непрочитанные Сообщения",
|
|
70
70
|
"Video": "видео",
|
|
71
71
|
"You": "Вы",
|
|
72
72
|
"You can't send messages in this channel": "",
|
|
73
73
|
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} и еще {{ nonSelfUserLength }} пишут",
|
|
74
74
|
"{{ index }} of {{ photoLength }}": "",
|
|
75
75
|
"{{ replyCount }} Replies": "{{ replyCount }} Ответов",
|
|
76
|
-
"{{ replyCount }} Thread Replies": "
|
|
76
|
+
"{{ replyCount }} Thread Replies": "",
|
|
77
77
|
"{{ user }} is typing": "{{ user }} пишет",
|
|
78
78
|
"🏙 Attachment...": "🏙 Вложение..."
|
|
79
79
|
}
|
package/src/i18n/tr.json
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
{
|
|
2
2
|
"1 Reply": "1 Cevap",
|
|
3
|
-
"1 Thread Reply": "
|
|
3
|
+
"1 Thread Reply": "",
|
|
4
4
|
"Allow access to your Gallery": "",
|
|
5
5
|
"Allow camera access in device settings": "",
|
|
6
6
|
"Also send to channel": "",
|
|
7
|
-
"Are you sure you want to permanently delete this message?": "",
|
|
8
|
-
"Are you sure?": "
|
|
9
|
-
"Block User": "",
|
|
10
|
-
"Cancel": "",
|
|
11
|
-
"Cannot Flag Message": "",
|
|
12
|
-
"Consider how your comment might make others feel and be sure to follow our Community Guidelines": "
|
|
13
|
-
"Copy Message": "",
|
|
14
|
-
"Delete": "",
|
|
15
|
-
"Delete Message": "",
|
|
7
|
+
"Are you sure you want to permanently delete this message?": "Bu mesajı kalıcı olarak silmek istediğinizden emin misiniz?",
|
|
8
|
+
"Are you sure?": "",
|
|
9
|
+
"Block User": "Kullanıcıyı engelle",
|
|
10
|
+
"Cancel": "İptal",
|
|
11
|
+
"Cannot Flag Message": "Raporlama Başarısız",
|
|
12
|
+
"Consider how your comment might make others feel and be sure to follow our Community Guidelines": "",
|
|
13
|
+
"Copy Message": "Mesajı Kopyala",
|
|
14
|
+
"Delete": "Sil",
|
|
15
|
+
"Delete Message": "Mesajı Sil",
|
|
16
16
|
"Device camera is used to take photos or videos.": "",
|
|
17
|
-
"Do you want to send a copy of this message to a moderator for further investigation?": "",
|
|
18
|
-
"Edit Message": "",
|
|
19
|
-
"Editing Message": "
|
|
20
|
-
"Emoji matching": "
|
|
17
|
+
"Do you want to send a copy of this message to a moderator for further investigation?": "Detaylı inceleme için bu mesajın kopyasını moderatöre göndermek istiyor musunuz?",
|
|
18
|
+
"Edit Message": "Mesajı Düzenle",
|
|
19
|
+
"Editing Message": "",
|
|
20
|
+
"Emoji matching": "",
|
|
21
21
|
"Empty message...": "Boş mesaj...",
|
|
22
|
-
"Error loading": "
|
|
22
|
+
"Error loading": "",
|
|
23
23
|
"Error loading channel list...": "Kanal listesi yüklenirken hata oluştu...",
|
|
24
24
|
"Error loading messages for this channel...": "Bu kanal için mesajlar yüklenirken hata oluştu...",
|
|
25
25
|
"Error while loading, please reload/refresh": "Yüklenirken hata oluştu, lütfen tekrar deneyiniz",
|
|
26
26
|
"File type not supported": "",
|
|
27
|
-
"Flag": "",
|
|
28
|
-
"Flag Message": "",
|
|
29
|
-
"Flag action failed either due to a network issue or the message is already flagged": "",
|
|
27
|
+
"Flag": "Raporla",
|
|
28
|
+
"Flag Message": "Mesajı Raporla",
|
|
29
|
+
"Flag action failed either due to a network issue or the message is already flagged": "Mesajın daha önce raporlanmış olması veya bir ağ bağlantısı sorunu nedeniyle raporlama işlemi başarısız oldu.",
|
|
30
30
|
"How about sending your first message to a friend?": "İlk mesajınızı bir arkadaşınıza göndermeye ne dersiniz?",
|
|
31
|
-
"Instant Commands": "
|
|
31
|
+
"Instant Commands": "",
|
|
32
32
|
"Let's start chatting!": "Haydi sohbete başlayalım!",
|
|
33
33
|
"Links are disabled": "Bağlantılar devre dışı",
|
|
34
|
-
"Loading channels...": "",
|
|
35
|
-
"Loading messages...": "",
|
|
36
|
-
"Loading...": "",
|
|
34
|
+
"Loading channels...": "Kanallar yükleniyor...",
|
|
35
|
+
"Loading messages...": "Mesajlar yükleniyor...",
|
|
36
|
+
"Loading...": "Yükleniyor...",
|
|
37
37
|
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Maksimum dosya boyutu yükleme sınırına ulaşıldı. Lütfen {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB'ın altında bir dosya yükleyin.",
|
|
38
|
-
"Message Reactions": "",
|
|
38
|
+
"Message Reactions": "Mesaj Tepkileri",
|
|
39
39
|
"Message deleted": "Mesaj silindi",
|
|
40
|
-
"Message flagged": "",
|
|
41
|
-
"Mute User": "",
|
|
40
|
+
"Message flagged": "Mesaj işaretlendi",
|
|
41
|
+
"Mute User": "Kullanıcıyı sessize al",
|
|
42
42
|
"Not supported": "",
|
|
43
43
|
"Nothing yet...": "Henüz değil...",
|
|
44
|
-
"Ok": "",
|
|
45
|
-
"Only visible to you": "
|
|
44
|
+
"Ok": "Tamam",
|
|
45
|
+
"Only visible to you": "",
|
|
46
46
|
"Open Settings": "",
|
|
47
47
|
"Photo": "Fotoğraf",
|
|
48
48
|
"Photos and Videos": "",
|
|
49
|
-
"Pin to Conversation": "",
|
|
49
|
+
"Pin to Conversation": "Konuşmaya sabitle",
|
|
50
50
|
"Pinned by": "",
|
|
51
51
|
"Please enable access to your photos and videos so you can share them.": "",
|
|
52
|
-
"Please select a channel first": "",
|
|
52
|
+
"Please select a channel first": "Lütfen önce bir kanal seçiniz",
|
|
53
53
|
"Reconnecting...": "Yeniden Bağlanılıyor...",
|
|
54
|
-
"Reply": "",
|
|
54
|
+
"Reply": "Yanıtla",
|
|
55
55
|
"Reply to Message": "",
|
|
56
|
-
"Resend": "",
|
|
57
|
-
"Search GIFs": "",
|
|
56
|
+
"Resend": "Yeniden gönder",
|
|
57
|
+
"Search GIFs": "GIF Ara",
|
|
58
58
|
"Select More Photos": "",
|
|
59
|
-
"Send Anyway": "
|
|
60
|
-
"Send a message": "",
|
|
59
|
+
"Send Anyway": "",
|
|
60
|
+
"Send a message": "Mesaj gönder",
|
|
61
61
|
"Sending links is not allowed in this conversation": "Bu konuşmada bağlantı göndermek desteklenmiyor",
|
|
62
|
-
"Slow mode ON": "",
|
|
63
|
-
"The message has been reported to a moderator.": "",
|
|
64
|
-
"Thread Reply": "",
|
|
65
|
-
"Unblock User": "",
|
|
62
|
+
"Slow mode ON": "Yavaş Mod Açık",
|
|
63
|
+
"The message has been reported to a moderator.": "Mesaj moderatöre bildirildi.",
|
|
64
|
+
"Thread Reply": "Konu Yanıtı",
|
|
65
|
+
"Unblock User": "Kullanıcının engelini kaldır",
|
|
66
66
|
"Unknown User": "",
|
|
67
|
-
"Unmute User": "",
|
|
68
|
-
"Unpin from Conversation": "",
|
|
69
|
-
"Unread Messages": "",
|
|
67
|
+
"Unmute User": "Kullanıcının sesini aç",
|
|
68
|
+
"Unpin from Conversation": "Sabitlemeyi kaldır",
|
|
69
|
+
"Unread Messages": "Okunmamış Mesajlar",
|
|
70
70
|
"Video": "Video",
|
|
71
71
|
"You": "Sen",
|
|
72
72
|
"You can't send messages in this channel": "",
|
|
73
73
|
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} ve {{ nonSelfUserLength }} kişi daha yazıyor",
|
|
74
74
|
"{{ index }} of {{ photoLength }}": "",
|
|
75
75
|
"{{ replyCount }} Replies": "{{ replyCount }} Cevap",
|
|
76
|
-
"{{ replyCount }} Thread Replies": "
|
|
76
|
+
"{{ replyCount }} Thread Replies": "",
|
|
77
77
|
"{{ user }} is typing": "{{ user }} yazıyor",
|
|
78
78
|
"🏙 Attachment...": "🏙 Ek..."
|
|
79
79
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DefaultStreamChatGenerics } from 'src/types/types';
|
|
2
|
+
import type { Channel } from 'stream-chat';
|
|
3
|
+
|
|
4
|
+
import { mapChannelToStorable } from '../mappers/mapChannelToStorable';
|
|
5
|
+
import { QuickSqliteClient } from '../QuickSqliteClient';
|
|
6
|
+
import { createUpsertQuery } from '../sqlite-utils/createUpsertQuery';
|
|
7
|
+
|
|
8
|
+
export const upsertChannelDataFromChannel = <
|
|
9
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
10
|
+
>({
|
|
11
|
+
channel,
|
|
12
|
+
flush = true,
|
|
13
|
+
}: {
|
|
14
|
+
channel: Channel<StreamChatGenerics>;
|
|
15
|
+
flush?: boolean;
|
|
16
|
+
}) => {
|
|
17
|
+
const storableChannel = mapChannelToStorable(channel);
|
|
18
|
+
if (!storableChannel) return;
|
|
19
|
+
const query = createUpsertQuery('channels', storableChannel);
|
|
20
|
+
if (flush) {
|
|
21
|
+
QuickSqliteClient.executeSqlBatch([query]);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return [query];
|
|
25
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Channel, ChannelResponse } from 'stream-chat';
|
|
2
|
+
|
|
3
|
+
import { mapDateTimeToStorable } from './mapDateTimeToStorable';
|
|
4
|
+
|
|
5
|
+
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
6
|
+
|
|
7
|
+
import type { TableRow } from '../types';
|
|
8
|
+
|
|
9
|
+
export const mapChannelToStorable = <
|
|
10
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
11
|
+
>(
|
|
12
|
+
channel: Channel<StreamChatGenerics>,
|
|
13
|
+
): TableRow<'channels'> | undefined => {
|
|
14
|
+
if (!channel.data) return;
|
|
15
|
+
const {
|
|
16
|
+
auto_translation_enabled,
|
|
17
|
+
auto_translation_language,
|
|
18
|
+
cid,
|
|
19
|
+
config,
|
|
20
|
+
cooldown,
|
|
21
|
+
created_at,
|
|
22
|
+
deleted_at,
|
|
23
|
+
disabled,
|
|
24
|
+
frozen,
|
|
25
|
+
hidden,
|
|
26
|
+
id,
|
|
27
|
+
invites,
|
|
28
|
+
last_message_at,
|
|
29
|
+
member_count,
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
31
|
+
members,
|
|
32
|
+
muted,
|
|
33
|
+
own_capabilities,
|
|
34
|
+
team,
|
|
35
|
+
truncated_at,
|
|
36
|
+
truncated_by,
|
|
37
|
+
truncated_by_id,
|
|
38
|
+
type,
|
|
39
|
+
updated_at,
|
|
40
|
+
...extraData
|
|
41
|
+
} = channel.data as unknown as ChannelResponse<StreamChatGenerics>;
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
autoTranslationEnabled: auto_translation_enabled,
|
|
45
|
+
autoTranslationLanguage: auto_translation_language,
|
|
46
|
+
cid,
|
|
47
|
+
config: config && JSON.stringify(config),
|
|
48
|
+
cooldown,
|
|
49
|
+
createdAt: mapDateTimeToStorable(created_at),
|
|
50
|
+
deletedAt: mapDateTimeToStorable(deleted_at),
|
|
51
|
+
disabled,
|
|
52
|
+
extraData: JSON.stringify(extraData),
|
|
53
|
+
frozen,
|
|
54
|
+
hidden,
|
|
55
|
+
id,
|
|
56
|
+
invites: invites && JSON.stringify(invites),
|
|
57
|
+
lastMessageAt: mapDateTimeToStorable(last_message_at),
|
|
58
|
+
memberCount: member_count,
|
|
59
|
+
muted,
|
|
60
|
+
ownCapabilities: own_capabilities && JSON.stringify(own_capabilities),
|
|
61
|
+
team,
|
|
62
|
+
truncatedAt: truncated_at,
|
|
63
|
+
truncatedBy: truncated_by && JSON.stringify(truncated_by),
|
|
64
|
+
truncatedById: truncated_by_id,
|
|
65
|
+
type,
|
|
66
|
+
updatedAt: updated_at,
|
|
67
|
+
};
|
|
68
|
+
};
|
|
@@ -90,7 +90,11 @@ export class DBSyncManager {
|
|
|
90
90
|
};
|
|
91
91
|
};
|
|
92
92
|
|
|
93
|
-
static sync = async
|
|
93
|
+
static sync = async <
|
|
94
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
95
|
+
>(
|
|
96
|
+
client: StreamChat<StreamChatGenerics>,
|
|
97
|
+
) => {
|
|
94
98
|
if (!this.client?.user) return;
|
|
95
99
|
const cids = getAllChannelIds();
|
|
96
100
|
// If there are no channels, then there is no need to sync.
|
|
@@ -113,7 +117,7 @@ export class DBSyncManager {
|
|
|
113
117
|
try {
|
|
114
118
|
const result = await this.client.sync(cids, lastSyncedAtDate.toISOString());
|
|
115
119
|
const queries = result.events.reduce<PreparedQueries[]>((queries, event) => {
|
|
116
|
-
queries = queries.concat(handleEventToSyncDB(event, false));
|
|
120
|
+
queries = queries.concat(handleEventToSyncDB(event, client, false));
|
|
117
121
|
return queries;
|
|
118
122
|
}, []);
|
|
119
123
|
|
|
@@ -137,7 +141,7 @@ export class DBSyncManager {
|
|
|
137
141
|
if (!this.client) return;
|
|
138
142
|
|
|
139
143
|
await this.executePendingTasks(this.client);
|
|
140
|
-
await this.sync();
|
|
144
|
+
await this.sync(this.client);
|
|
141
145
|
};
|
|
142
146
|
|
|
143
147
|
static queueTask = async <
|
package/src/version.json
CHANGED