remove sending to false on first loade page

This commit is contained in:
Peter Maquiran
2024-08-07 16:02:05 +01:00
parent d55450ccbb
commit b61b87ce6c
3 changed files with 20 additions and 1 deletions
@@ -80,6 +80,17 @@ export class MessageLocalDataSourceService {
// })
}
async setAllSenderToFalse() {
try {
await messageDataSource.transaction('rw', messageDataSource.message, async () => {
// Perform the update operation within the transaction
await messageDataSource.message.toCollection().modify({ sending: false });
});
console.log('All messages updated successfully.');
} catch (error) {
console.error('Error updating messages:', error);
}
}
async getLastMessageByRoomId(roomId: string): Promise<Result<undefined|TableMessage, any>> {
try {