mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-06-05 12:34:34 +02:00
Add Dexie for persistence; user management with dexie; this is the way
This commit is contained in:
parent
8036aa2942
commit
23d275acec
16 changed files with 285 additions and 494 deletions
web/src/app
|
@ -6,7 +6,11 @@ class ConnectionManager {
|
|||
}
|
||||
|
||||
refresh(subscriptions, users, onNotification) {
|
||||
if (!subscriptions || !users) {
|
||||
return;
|
||||
}
|
||||
console.log(`[ConnectionManager] Refreshing connections`);
|
||||
console.log(users);
|
||||
const subscriptionIds = subscriptions.ids();
|
||||
const deletedIds = Array.from(this.connections.keys()).filter(id => !subscriptionIds.includes(id));
|
||||
|
||||
|
@ -16,7 +20,7 @@ class ConnectionManager {
|
|||
if (added) {
|
||||
const baseUrl = subscription.baseUrl;
|
||||
const topic = subscription.topic;
|
||||
const user = users.get(baseUrl);
|
||||
const [user] = users.filter(user => user.baseUrl === baseUrl);
|
||||
const since = subscription.last;
|
||||
const connection = new Connection(id, baseUrl, topic, user, since, onNotification);
|
||||
this.connections.set(id, connection);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue