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.
-
-
-
-
-
-
- )
- }
-
if (store.me.invites.length === 0) {
return (
diff --git a/src/view/screens/Settings.tsx b/src/view/screens/Settings.tsx
index f75222c1f5..2112ec7d12 100644
--- a/src/view/screens/Settings.tsx
+++ b/src/view/screens/Settings.tsx
@@ -322,45 +322,37 @@ export const SettingsScreen = withAuthRequired(
- {store.me.invitesAvailable !== null && (
- <>
-
- Invite a Friend
-
-
- 0 ? primaryBg : pal.btn,
- ]}>
- 0
- ? primaryText
- : pal.text) as FontAwesomeIconStyle
- }
- />
-
- 0 ? pal.link : pal.text}>
- {formatCount(store.me.invitesAvailable)} invite{' '}
- {pluralize(store.me.invitesAvailable, 'code')} available
-
-
- >
- )}
+
+ Invite a Friend
+
+
+ 0 ? primaryBg : pal.btn,
+ ]}>
+ 0
+ ? primaryText
+ : pal.text) as FontAwesomeIconStyle
+ }
+ />
+
+ 0 ? pal.link : pal.text}>
+ {formatCount(store.me.invitesAvailable)} invite{' '}
+ {pluralize(store.me.invitesAvailable, 'code')} available
+
+
diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx
index 48341170c5..51a846c4ae 100644
--- a/src/view/shell/Drawer.tsx
+++ b/src/view/shell/Drawer.tsx
@@ -426,34 +426,32 @@ const InviteCodes = observer(function InviteCodesImpl({
store.shell.openModal({name: 'invite-codes'})
}, [store, track])
return (
- store.me.invitesAvailable !== null && (
-
- 0 ? pal.link : pal.textLight,
- ]}
- size={18}
- />
- 0 ? pal.link : pal.textLight}>
- {formatCount(store.me.invitesAvailable)} invite{' '}
- {pluralize(store.me.invitesAvailable, 'code')}
-
-
- )
+
+ 0 ? pal.link : pal.textLight,
+ ]}
+ size={18}
+ />
+ 0 ? pal.link : pal.textLight}>
+ {formatCount(store.me.invitesAvailable)} invite{' '}
+ {pluralize(store.me.invitesAvailable, 'code')}
+
+
)
})
diff --git a/src/view/shell/desktop/RightNav.tsx b/src/view/shell/desktop/RightNav.tsx
index f0e986bf46..84d7d78547 100644
--- a/src/view/shell/desktop/RightNav.tsx
+++ b/src/view/shell/desktop/RightNav.tsx
@@ -7,7 +7,6 @@ import {DesktopSearch} from './Search'
import {DesktopFeeds} from './Feeds'
import {Text} from 'view/com/util/text/Text'
import {TextLink} from 'view/com/util/Link'
-import {LoadingPlaceholder} from 'view/com/util/LoadingPlaceholder'
import {FEEDBACK_FORM_URL, HELP_DESK_URL} from 'lib/constants'
import {s} from 'lib/styles'
import {useStores} from 'state/index'
@@ -90,41 +89,32 @@ const InviteCodes = observer(function InviteCodesImpl() {
const onPress = React.useCallback(() => {
store.shell.openModal({name: 'invite-codes'})
}, [store])
-
return (
-
- {store.me.invitesAvailable === null ? (
-
-
-
- ) : (
-
- 0 ? pal.link : pal.textLight,
- ]}
- size={16}
- />
- 0 ? pal.link : pal.textLight}>
- {formatCount(store.me.invitesAvailable)} invite{' '}
- {pluralize(store.me.invitesAvailable, 'code')} available
-
-
- )}
-
+
+ 0 ? pal.link : pal.textLight,
+ ]}
+ size={16}
+ />
+ 0 ? pal.link : pal.textLight}>
+ {formatCount(store.me.invitesAvailable)} invite{' '}
+ {pluralize(store.me.invitesAvailable, 'code')} available
+
+
)
})
@@ -141,20 +131,16 @@ const styles = StyleSheet.create({
message: {
paddingVertical: 18,
- paddingHorizontal: 12,
+ paddingHorizontal: 10,
},
messageLine: {
marginBottom: 10,
},
- separator: {
- borderTopWidth: 1,
- },
- br40: {borderRadius: 40},
-
inviteCodes: {
- paddingHorizontal: 12,
- paddingVertical: 16,
+ borderTopWidth: 1,
+ paddingHorizontal: 16,
+ paddingVertical: 12,
flexDirection: 'row',
alignItems: 'center',
},