From 391a2a71e0e948956bf737af2e62f1937d26d2b9 Mon Sep 17 00:00:00 2001 From: SondreB Date: Sun, 29 Jan 2023 20:04:04 +0100 Subject: [PATCH] Fix Circle Service with new database code --- src/app/app.ts | 9 +- src/app/circles/circles.html | 85 +++++++++---------- src/app/circles/circles.ts | 20 ++--- src/app/home/home.ts | 4 +- src/app/services/circle.ts | 45 ++++------ src/app/services/interfaces.ts | 6 ++ src/app/services/relay.ts | 2 - src/app/services/storage.ts | 34 +++++++- .../profile-actions/profile-actions.html | 2 +- src/app/types/storage.ts | 27 +++++- src/app/workers/relay.worker.ts | 2 - 11 files changed, 139 insertions(+), 97 deletions(-) diff --git a/src/app/app.ts b/src/app/app.ts index 6ded60d..4f7aa44 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -185,6 +185,7 @@ export class AppComponent { /** Run initialize whenever user has been authenticated. */ async initialize() { + debugger; // await this.storage.open(); // await this.storage.initialize(); await this.db.initialize('blockcore-' + this.appState.getPublicKey()); @@ -253,6 +254,8 @@ export class AppComponent { }, }); + debugger; + // Create the listeners (filters) for relays: // TODO: There is limit on maximum following, we need a strategy to handle that. // potentially subscribing and unsubscribing on intervals with a .since field between each interval. @@ -263,7 +266,11 @@ export class AppComponent { console.log('PUB KEYS:', pubKeys); - this.relayService.queueSubscription([{ authors: pubKeys }]); + // Subscribe to new events but don't get any history (limit: 0). + + console.log('queueSubscription:', { authors: pubKeys, since: this.db.state.since }); + + this.relayService.queueSubscription([{ authors: pubKeys, since: this.db.state.since }]); // this.relayService. diff --git a/src/app/circles/circles.html b/src/app/circles/circles.html index 1664304..7e16d9c 100644 --- a/src/app/circles/circles.html +++ b/src/app/circles/circles.html @@ -2,53 +2,44 @@
- - -
- - -
trip_origin
-
- {{ circle.name }}
- Count: {{ countMembers(circle) }}
- Public Private - {{ circle.style | circlestyle }} - Created: {{ circle.created | ago }} -
-
- - - - - - - - - - - -
-
-
- - Error {{ items.error }} -
- - + + +
trip_origin
+
+ {{ circle.name }}
+ Count: {{ countMembers(circle) }}
+ Public Private - {{ circle.style | circlestyle }} - Created: {{ circle.created | ago }} +
+
+ + + + + + + + + + + +
+
+