Fix notification fetch abort condition
This commit is contained in:
@@ -356,7 +356,9 @@ export class NotificationsFeedModel {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.rootStore.log.error('NotificationsModel:processQueue failed', {e})
|
this.rootStore.log.error('NotificationsModel:processQueue failed', {e})
|
||||||
} finally {
|
} finally {
|
||||||
this.isRefreshing = false
|
runInAction(() => {
|
||||||
|
this.isRefreshing = false
|
||||||
|
})
|
||||||
this.lock.release()
|
this.lock.release()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -508,7 +510,7 @@ export class NotificationsFeedModel {
|
|||||||
}
|
}
|
||||||
accRes.data.notifications.push(notif)
|
accRes.data.notifications.push(notif)
|
||||||
}
|
}
|
||||||
if (pageIsDone) {
|
if (pageIsDone || res.data.notifications.length < PAGE_SIZE) {
|
||||||
return accRes
|
return accRes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ export const NotificationsScreen = withAuthRequired(
|
|||||||
onScroll={onMainScroll}
|
onScroll={onMainScroll}
|
||||||
scrollElRef={scrollElRef}
|
scrollElRef={scrollElRef}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{store.me.notifications.hasNewLatest &&
|
{store.me.notifications.hasNewLatest &&
|
||||||
!store.me.notifications.isRefreshing && (
|
!store.me.notifications.isRefreshing && (
|
||||||
<LoadLatestBtn onPress={onPressLoadLatest} label="notifications" />
|
<LoadLatestBtn onPress={onPressLoadLatest} label="notifications" />
|
||||||
|
|||||||
Reference in New Issue
Block a user