diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/state/models/notifications-view.ts | 3 | ||||
-rw-r--r-- | src/state/models/root-store.ts | 4 | ||||
-rw-r--r-- | src/view/screens/Notifications.tsx | 6 | ||||
-rw-r--r-- | src/view/shell/mobile/index.tsx | 5 |
4 files changed, 15 insertions, 3 deletions
diff --git a/src/state/models/notifications-view.ts b/src/state/models/notifications-view.ts index 048de968d..e88af590b 100644 --- a/src/state/models/notifications-view.ts +++ b/src/state/models/notifications-view.ts @@ -405,6 +405,9 @@ export class NotificationsViewModel { try { this.unreadCount = 0 this.rootStore.emitUnreadNotifications(0) + for (const notif of this.notifications) { + notif.isRead = true + } await this.rootStore.api.app.bsky.notification.updateSeen({ seenAt: new Date().toISOString(), }) diff --git a/src/state/models/root-store.ts b/src/state/models/root-store.ts index d60df7dde..43523b759 100644 --- a/src/state/models/root-store.ts +++ b/src/state/models/root-store.ts @@ -46,10 +46,14 @@ export class RootStoreModel { hackUpgradeNeeded = false async hackCheckIfUpgradeNeeded() { try { + this.log.debug('hackCheckIfUpgradeNeeded()') const res = await fetch('https://bsky.social/xrpc/app.bsky.feed.getLikes') await res.text() runInAction(() => { this.hackUpgradeNeeded = res.status !== 501 + this.log.debug( + `hackCheckIfUpgradeNeeded() said ${this.hackUpgradeNeeded}`, + ) }) } catch (e) { this.log.error('Failed to hackCheckIfUpgradeNeeded', {e}) diff --git a/src/view/screens/Notifications.tsx b/src/view/screens/Notifications.tsx index b046ee1b7..f1a9e8bf0 100644 --- a/src/view/screens/Notifications.tsx +++ b/src/view/screens/Notifications.tsx @@ -61,13 +61,13 @@ export const Notifications = ({navIdx, visible}: ScreenParams) => { // = useEffect(() => { if (!visible) { + // mark read when the user leaves the screen + store.me.notifications.markAllRead() return } store.log.debug('NotificationsScreen: Updating feed') const softResetSub = store.onScreenSoftReset(scrollToTop) - store.me.notifications.update().then(() => { - store.me.notifications.markAllRead() - }) + store.me.notifications.update() screen('Notifications') store.nav.setTitle(navIdx, 'Notifications') return () => { diff --git a/src/view/shell/mobile/index.tsx b/src/view/shell/mobile/index.tsx index 6caf89232..dbfcad0ee 100644 --- a/src/view/shell/mobile/index.tsx +++ b/src/view/shell/mobile/index.tsx @@ -398,6 +398,11 @@ export const MobileShell: React.FC = observer(() => { if (!store.session.hasSession) { return ( <View style={styles.outerContainer}> + <StatusBar + barStyle={ + theme.colorScheme === 'dark' ? 'light-content' : 'dark-content' + } + /> <Login /> <ModalsContainer /> </View> |