diff options
Diffstat (limited to 'src/state/models/me.ts')
-rw-r--r-- | src/state/models/me.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/state/models/me.ts b/src/state/models/me.ts index 3774e1e56..e8b8e1ed0 100644 --- a/src/state/models/me.ts +++ b/src/state/models/me.ts @@ -7,6 +7,7 @@ import {MyFollowsCache} from './cache/my-follows' import {isObj, hasProp} from 'lib/type-guards' const PROFILE_UPDATE_INTERVAL = 10 * 60 * 1e3 // 10min +const NOTIFS_UPDATE_INTERVAL = 30 * 1e3 // 30sec export class MeModel { did: string = '' @@ -21,6 +22,7 @@ export class MeModel { follows: MyFollowsCache invites: ComAtprotoServerDefs.InviteCode[] = [] lastProfileStateUpdate = Date.now() + lastNotifsUpdate = Date.now() get invitesAvailable() { return this.invites.filter(isInviteAvailable).length @@ -119,7 +121,10 @@ export class MeModel { await this.fetchProfile() await this.fetchInviteCodes() } - await this.notifications.syncQueue() + if (Date.now() - this.lastNotifsUpdate > NOTIFS_UPDATE_INTERVAL) { + this.lastNotifsUpdate = Date.now() + await this.notifications.syncQueue() + } } async fetchProfile() { |