Merge pull request #16 from cheeaun/main

Update from main
This commit is contained in:
Chee Aun 2022-12-22 08:44:56 +08:00 committed by GitHub
commit 940e8f5376
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,12 +85,15 @@ function Home({ hidden }) {
setUIState('loading'); setUIState('loading');
setTimeout(() => { setTimeout(() => {
(async () => { (async () => {
const newStatus = await masto.timelines.fetchHome({ const newStatuses = await masto.timelines.fetchHome({
limit: 2, limit: 2,
// Need 2 because "new posts" only appear when there are 2 or more // Need 2 because "new posts" only appear when there are 2 or more
}); });
if (newStatus.length && newStatus[0].id !== states.home[0].id) { if (
states.homeNew = newStatus; newStatuses.value.length &&
newStatuses.value[0].id !== states.home[0].id
) {
states.homeNew = newStatuses.value;
} }
setUIState('default'); setUIState('default');
})(); })();