forked from blisstown/campfire
another huge commit but we have notifs now yay
This commit is contained in:
parent
015a3e65e1
commit
998e8f2517
17 changed files with 442 additions and 52 deletions
|
@ -28,7 +28,21 @@
|
|||
client.user = user
|
||||
return client;
|
||||
});
|
||||
goto("/");
|
||||
|
||||
return get(client).getNotifications(
|
||||
get(last_read_notification_id)
|
||||
).then(notif_data => {
|
||||
client.update(client => {
|
||||
// we've just logged in, so assume all past notifications are read.
|
||||
// i *would* just use the mastodon marker API to get the last read
|
||||
// notification, but this does not appear to be widely supported.
|
||||
if (notif_data.constructor === Array && notif_data.length > 0)
|
||||
last_read_notification_id.set(notif_data[0].id);
|
||||
client.save();
|
||||
return client;
|
||||
});
|
||||
goto("/");
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue