Always clear 'new' when load from beginning

This commit is contained in:
Lim Chee Aun 2023-01-02 23:19:12 +08:00
parent 5074716378
commit d235f56cff
2 changed files with 2 additions and 2 deletions

View file

@ -47,6 +47,7 @@ function Home({ hidden }) {
});
if (firstLoad) {
states.home = homeValues;
states.homeNew = [];
} else {
states.home.push(...homeValues);
}
@ -255,7 +256,6 @@ function Home({ hidden }) {
);
states.home.unshift(...uniqueHomeNew);
loadStatuses(true);
states.homeNew = [];
scrollableRef.current?.scrollTo({
top: 0,

View file

@ -235,6 +235,7 @@ function Notifications() {
});
if (firstLoad) {
states.notifications = notificationsValues;
states.notificationsNew = [];
} else {
states.notifications.push(...notificationsValues);
}
@ -257,7 +258,6 @@ function Notifications() {
useEffect(() => {
loadNotifications(true);
states.notificationsNew = [];
}, []);
const scrollableRef = useRef();