|
|
@@ -5,6 +5,10 @@ import BlockedUser from 'src/watermelondb/models/BlockedUser';
|
|
|
import { chatApi } from '@api/chat';
|
|
|
import NetInfo from '@react-native-community/netinfo';
|
|
|
import { testConnectionSpeed } from 'src/database/speedService';
|
|
|
+import dayjs from 'dayjs';
|
|
|
+import utc from 'dayjs/plugin/utc';
|
|
|
+
|
|
|
+dayjs.extend(utc);
|
|
|
|
|
|
export type DirtyAction = {
|
|
|
type: 'pin' | 'archive' | 'mute' | 'block' | 'unblock' | 'delete' | 'leave_group';
|
|
|
@@ -380,7 +384,7 @@ async function pullUpdates(token: string) {
|
|
|
typeof s.updated === 'number'
|
|
|
? s.updated
|
|
|
: s.updated
|
|
|
- ? new Date(s.updated).getTime()
|
|
|
+ ? dayjs.utc(s.updated, 'YYYY-MM-DD HH:mm:ss', true).valueOf()
|
|
|
: Date.now();
|
|
|
|
|
|
r.status = s.status ?? 0;
|
|
|
@@ -437,7 +441,7 @@ async function pullUpdates(token: string) {
|
|
|
typeof server.updated === 'number'
|
|
|
? server.updated
|
|
|
: server.updated
|
|
|
- ? new Date(server.updated).getTime()
|
|
|
+ ? dayjs.utc(server.updated, 'YYYY-MM-DD HH:mm:ss', true).valueOf()
|
|
|
: r.updated;
|
|
|
r.status = server.status ?? r.status;
|
|
|
r.unreadCount = server.unread_count ?? r.unreadCount;
|