Fix notification fetch abort condition

This commit is contained in:
Paul Frazee
2023-04-11 21:42:39 -07:00
parent e27cd65bb9
commit 866a5da0f0
2 changed files with 4 additions and 3 deletions
+4 -2
View File
@@ -356,7 +356,9 @@ export class NotificationsFeedModel {
} catch (e) {
this.rootStore.log.error('NotificationsModel:processQueue failed', {e})
} finally {
this.isRefreshing = false
runInAction(() => {
this.isRefreshing = false
})
this.lock.release()
}
})
@@ -508,7 +510,7 @@ export class NotificationsFeedModel {
}
accRes.data.notifications.push(notif)
}
if (pageIsDone) {
if (pageIsDone || res.data.notifications.length < PAGE_SIZE) {
return accRes
}
}
-1
View File
@@ -70,7 +70,6 @@ export const NotificationsScreen = withAuthRequired(
onScroll={onMainScroll}
scrollElRef={scrollElRef}
/>
{store.me.notifications.hasNewLatest &&
!store.me.notifications.isRefreshing && (
<LoadLatestBtn onPress={onPressLoadLatest} label="notifications" />