fix: config preferences
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
import * as utils from "@noble/curves/abstract/utils";
|
import * as utils from "@noble/curves/abstract/utils";
|
||||||
import * as secp from "@noble/curves/secp256k1";
|
import * as secp from "@noble/curves/secp256k1";
|
||||||
import { deepClone, ExternalStore, unwrap } from "@snort/shared";
|
import { ExternalStore, unwrap } from "@snort/shared";
|
||||||
import { EventPublisher, HexKey, KeyStorage, NotEncrypted, RelaySettings, socialGraphInstance } from "@snort/system";
|
import { EventPublisher, HexKey, KeyStorage, NotEncrypted, RelaySettings, socialGraphInstance } from "@snort/system";
|
||||||
import { v4 as uuid } from "uuid";
|
import { v4 as uuid } from "uuid";
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ const LoggedOut = {
|
|||||||
|
|
||||||
export class MultiAccountStore extends ExternalStore<LoginSession> {
|
export class MultiAccountStore extends ExternalStore<LoginSession> {
|
||||||
#activeAccount?: HexKey;
|
#activeAccount?: HexKey;
|
||||||
#accounts: Map<string, LoginSession>;
|
#accounts: Map<string, LoginSession> = new Map();
|
||||||
#publishers = new Map<string, EventPublisher>();
|
#publishers = new Map<string, EventPublisher>();
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -91,6 +91,7 @@ export class MultiAccountStore extends ExternalStore<LoginSession> {
|
|||||||
v.appData ??= {
|
v.appData ??= {
|
||||||
item: {
|
item: {
|
||||||
mutedWords: [],
|
mutedWords: [],
|
||||||
|
showContentWarningPosts: false,
|
||||||
preferences: DefaultPreferences,
|
preferences: DefaultPreferences,
|
||||||
},
|
},
|
||||||
timestamp: 0,
|
timestamp: 0,
|
||||||
@ -162,7 +163,10 @@ export class MultiAccountStore extends ExternalStore<LoginSession> {
|
|||||||
item: initRelays,
|
item: initRelays,
|
||||||
timestamp: 1,
|
timestamp: 1,
|
||||||
},
|
},
|
||||||
preferences: deepClone(DefaultPreferences),
|
preferences: {
|
||||||
|
...DefaultPreferences,
|
||||||
|
...CONFIG.defaultPreferences
|
||||||
|
},
|
||||||
remoteSignerRelays,
|
remoteSignerRelays,
|
||||||
privateKeyData: privateKey,
|
privateKeyData: privateKey,
|
||||||
stalker: stalker ?? false,
|
stalker: stalker ?? false,
|
||||||
@ -205,7 +209,10 @@ export class MultiAccountStore extends ExternalStore<LoginSession> {
|
|||||||
item: initRelays,
|
item: initRelays,
|
||||||
timestamp: 1,
|
timestamp: 1,
|
||||||
},
|
},
|
||||||
preferences: deepClone(DefaultPreferences),
|
preferences: {
|
||||||
|
...DefaultPreferences,
|
||||||
|
...CONFIG.defaultPreferences
|
||||||
|
},
|
||||||
} as LoginSession;
|
} as LoginSession;
|
||||||
|
|
||||||
if ("nostr_os" in window && window?.nostr_os) {
|
if ("nostr_os" in window && window?.nostr_os) {
|
||||||
|
@ -122,5 +122,4 @@ export const DefaultPreferences = {
|
|||||||
checkSigs: true,
|
checkSigs: true,
|
||||||
autoTranslate: true,
|
autoTranslate: true,
|
||||||
hideMutedNotes: false,
|
hideMutedNotes: false,
|
||||||
...(CONFIG ?? {})?.defaultPreferences,
|
|
||||||
} as UserPreferences;
|
} as UserPreferences;
|
||||||
|
Reference in New Issue
Block a user