From 65cbd547defdfe0c5b5810d85928f4760d7026d7 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Tue, 10 Oct 2023 10:03:34 -0700 Subject: [PATCH] Revert "Fix invite codes flash on desktop, use loading placeholder (#1591)" This reverts commit 9278822088d212c9bee6a40a6a8b773bc482242d. --- src/state/models/me.ts | 8 ++-- src/view/com/modals/InviteCodes.tsx | 27 ----------- src/view/screens/Settings.tsx | 70 +++++++++++++--------------- src/view/shell/Drawer.tsx | 54 +++++++++++----------- src/view/shell/desktop/RightNav.tsx | 72 ++++++++++++----------------- 5 files changed, 89 insertions(+), 142 deletions(-) diff --git a/src/state/models/me.ts b/src/state/models/me.ts index 8a7a4c851e..186e61cf6b 100644 --- a/src/state/models/me.ts +++ b/src/state/models/me.ts @@ -25,13 +25,13 @@ export class MeModel { savedFeeds: SavedFeedsModel notifications: NotificationsFeedModel follows: MyFollowsCache - invites: ComAtprotoServerDefs.InviteCode[] | null = [] + invites: ComAtprotoServerDefs.InviteCode[] = [] appPasswords: ComAtprotoServerListAppPasswords.AppPassword[] = [] lastProfileStateUpdate = Date.now() lastNotifsUpdate = Date.now() get invitesAvailable() { - return this.invites?.filter(isInviteAvailable).length || null + return this.invites.filter(isInviteAvailable).length } constructor(public rootStore: RootStoreModel) { @@ -180,9 +180,7 @@ export class MeModel { } catch (e) { this.rootStore.log.error('Failed to fetch user invite codes', e) } - if (this.invites) { - await this.rootStore.invitedUsers.fetch(this.invites) - } + await this.rootStore.invitedUsers.fetch(this.invites) } } diff --git a/src/view/com/modals/InviteCodes.tsx b/src/view/com/modals/InviteCodes.tsx index 0cb0c56aae..09cfd4de79 100644 --- a/src/view/com/modals/InviteCodes.tsx +++ b/src/view/com/modals/InviteCodes.tsx @@ -26,33 +26,6 @@ export function Component({}: {}) { store.shell.closeModal() }, [store]) - if (store.me.invites === null) { - return ( - - - Error - - - An error occurred while loading invite codes. - - - -