mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-29 04:38:55 +03:00
Always clear 'new' when load from beginning
This commit is contained in:
parent
5074716378
commit
d235f56cff
2 changed files with 2 additions and 2 deletions
|
@ -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,
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue