mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Refactor fetchListIncrementally to use RelayBatchFetcher
This change completes the refactoring of `fetchListIncrementally` by: 1. Importing `RelayBatchFetcher` in `js/nostr/client.js`. 2. Instantiating `RelayBatchFetcher` in `NostrClient` constructor. 3. Ensuring `RelayBatchFetcher` receives the client instance. The complex logic was already moved to `js/nostr/relayBatchFetcher.js`, but the integration was missing, causing runtime errors. This change fixes the wiring and ensures the new class is used. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
286e676280
commit
31d6730c59
2 files changed
+5
No files matched your search
@@ -215,6 +215,7 @@ import { EventsMap } from "./eventsMap.js";
|
||||
import { PersistenceManager } from "./managers/PersistenceManager.js";
|
||||
import { ConnectionManager } from "./managers/ConnectionManager.js";
|
||||
import { SignerManager } from "./managers/SignerManager.js";
|
||||
import { RelayBatchFetcher } from "./relayBatchFetcher.js";
|
||||
|
||||
function normalizeProfileFromEvent(event) {
|
||||
if (!event || !event.content) return null;
|
||||
@@ -580,6 +581,7 @@ export class NostrClient {
|
||||
constructor() {
|
||||
this.connectionManager = new ConnectionManager(this);
|
||||
this.signerManager = new SignerManager(this);
|
||||
this.relayBatchFetcher = new RelayBatchFetcher(this);
|
||||
|
||||
/**
|
||||
* @type {Map<string, object>}
|
||||
|
||||
@@ -5,6 +5,9 @@ import { normalizeNostrPubkey, sanitizeRelayList } from "./nip46Client.js";
|
||||
import { DEFAULT_RELAY_URLS, RELAY_URLS } from "./toolkit.js";
|
||||
|
||||
export class RelayBatchFetcher {
|
||||
/**
|
||||
* @param {import("./client.js").NostrClient} client
|
||||
*/
|
||||
constructor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user