|
@@ -96,7 +96,8 @@ import {
|
|
|
OutgoingWsEvent,
|
|
OutgoingWsEvent,
|
|
|
reconcileChatRange,
|
|
reconcileChatRange,
|
|
|
triggerMessagePush,
|
|
triggerMessagePush,
|
|
|
- upsertMessagesIntoDB
|
|
|
|
|
|
|
+ upsertMessagesIntoDB,
|
|
|
|
|
+ findGroupMsgRecord
|
|
|
} from 'src/watermelondb/features/chat/data/message.sync';
|
|
} from 'src/watermelondb/features/chat/data/message.sync';
|
|
|
import { database } from 'src/watermelondb';
|
|
import { database } from 'src/watermelondb';
|
|
|
import { Q } from '@nozbe/watermelondb';
|
|
import { Q } from '@nozbe/watermelondb';
|
|
@@ -110,15 +111,6 @@ const options = {
|
|
|
|
|
|
|
|
const reactionEmojis = ['👍', '❤️', '😂', '😮', '😭'];
|
|
const reactionEmojis = ['👍', '❤️', '😂', '😮', '😭'];
|
|
|
|
|
|
|
|
-export async function findGroupMsgRecord(id: number, groupToken: string): Promise<Message | null> {
|
|
|
|
|
- const messagesCollection = database.get<Message>('messages');
|
|
|
|
|
-
|
|
|
|
|
- const res = await messagesCollection
|
|
|
|
|
- .query(Q.where('chat_key', 'g:' + groupToken), Q.where('message_id', id))
|
|
|
|
|
- .fetch();
|
|
|
|
|
- return res[0] ?? null;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
const GroupChatScreen = ({ route }: { route: any }) => {
|
|
const GroupChatScreen = ({ route }: { route: any }) => {
|
|
|
const token = storage.get('token', StoreType.STRING) as string;
|
|
const token = storage.get('token', StoreType.STRING) as string;
|
|
|
const [isConnected, setIsConnected] = useState<boolean>(true);
|
|
const [isConnected, setIsConnected] = useState<boolean>(true);
|