mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-18 19:41:48 +02:00
fix setting loading
This commit is contained in:
5
.changeset/itchy-onions-confess.md
Normal file
5
.changeset/itchy-onions-confess.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"nostrudel": patch
|
||||
---
|
||||
|
||||
Fix user app settings being cached
|
@@ -35,7 +35,7 @@ export async function loadSettings() {
|
||||
appSettings.next(account.localSettings);
|
||||
}
|
||||
} else {
|
||||
const subject = userAppSettings.requestAppSettings(account.pubkey, clientRelaysService.getReadUrls());
|
||||
const subject = userAppSettings.requestAppSettings(account.pubkey, clientRelaysService.getReadUrls(), true);
|
||||
appSettings.connect(subject);
|
||||
}
|
||||
}
|
||||
|
@@ -63,15 +63,8 @@ class UserAppSettings {
|
||||
requester: CachedPubkeyEventRequester;
|
||||
constructor() {
|
||||
this.requester = new CachedPubkeyEventRequester(30078, "user-app-data", DTAG);
|
||||
this.requester.readCache = this.readCache;
|
||||
this.requester.writeCache = this.writeCache;
|
||||
}
|
||||
|
||||
readCache(pubkey: string) {
|
||||
return db.get("settings", pubkey);
|
||||
}
|
||||
writeCache(pubkey: string, event: NostrEvent) {
|
||||
return db.put("settings", event);
|
||||
this.requester.readCache = (pubkey) => db.get("settings", pubkey);
|
||||
this.requester.writeCache = (pubkey, event) => db.put("settings", event);
|
||||
}
|
||||
|
||||
private parsedSubjects = new SuperMap<string, PersistentSubject<AppSettings>>(
|
||||
|
Reference in New Issue
Block a user