mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-23 09:06:23 +01:00
parent
e0e236bd26
commit
3490b0e714
1 changed files with 7 additions and 7 deletions
|
@ -25,13 +25,6 @@ function Following({ title, path, id, headerStart }) {
|
||||||
const results = await homeIterator.current.next();
|
const results = await homeIterator.current.next();
|
||||||
const { value } = results;
|
const { value } = results;
|
||||||
if (value?.length) {
|
if (value?.length) {
|
||||||
// ENFORCE sort by datetime (Latest first)
|
|
||||||
value.sort((a, b) => {
|
|
||||||
const aDate = new Date(a.createdAt);
|
|
||||||
const bDate = new Date(b.createdAt);
|
|
||||||
return bDate - aDate;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (firstLoad) {
|
if (firstLoad) {
|
||||||
latestItem.current = value[0].id;
|
latestItem.current = value[0].id;
|
||||||
}
|
}
|
||||||
|
@ -39,6 +32,13 @@ function Following({ title, path, id, headerStart }) {
|
||||||
value.forEach((item) => {
|
value.forEach((item) => {
|
||||||
saveStatus(item, instance);
|
saveStatus(item, instance);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ENFORCE sort by datetime (Latest first)
|
||||||
|
value.sort((a, b) => {
|
||||||
|
const aDate = new Date(a.createdAt);
|
||||||
|
const bDate = new Date(b.createdAt);
|
||||||
|
return bDate - aDate;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue