Fix invite codes flash on desktop, use loading placeholder (#1591)
* Fix invite codes flashing untrue value before loaded * Add loading placeholder for right nav invites
This commit is contained in:
parent
2ba0c6a711
commit
9278822088
5 changed files with 142 additions and 89 deletions
|
@ -25,13 +25,13 @@ export class MeModel {
|
|||
savedFeeds: SavedFeedsModel
|
||||
notifications: NotificationsFeedModel
|
||||
follows: MyFollowsCache
|
||||
invites: ComAtprotoServerDefs.InviteCode[] = []
|
||||
invites: ComAtprotoServerDefs.InviteCode[] | null = []
|
||||
appPasswords: ComAtprotoServerListAppPasswords.AppPassword[] = []
|
||||
lastProfileStateUpdate = Date.now()
|
||||
lastNotifsUpdate = Date.now()
|
||||
|
||||
get invitesAvailable() {
|
||||
return this.invites.filter(isInviteAvailable).length
|
||||
return this.invites?.filter(isInviteAvailable).length || null
|
||||
}
|
||||
|
||||
constructor(public rootStore: RootStoreModel) {
|
||||
|
@ -180,7 +180,9 @@ export class MeModel {
|
|||
} catch (e) {
|
||||
this.rootStore.log.error('Failed to fetch user invite codes', e)
|
||||
}
|
||||
await this.rootStore.invitedUsers.fetch(this.invites)
|
||||
if (this.invites) {
|
||||
await this.rootStore.invitedUsers.fetch(this.invites)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue