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

View file

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