diff --git a/src/stores/nostr.ts b/src/stores/nostr.ts index 922d3e38..ef85a240 100644 --- a/src/stores/nostr.ts +++ b/src/stores/nostr.ts @@ -6,6 +6,7 @@ import { useWalletStore } from "./wallet"; import { generateSecretKey, getPublicKey } from 'nostr-tools' import { useLocalStorage } from "@vueuse/core"; import { useSettingsStore } from "./settings"; + type MintRecommendation = { url: string; count: number; @@ -33,6 +34,7 @@ export const useNostrStore = defineStore("nostr", { privateKeySigner: {} as NDKPrivateKeySigner, signer: {} as NDKSigner, mintRecommendations: useLocalStorage("cashu.ndk.mintRecommendations", []), + initialized: false, }), getters: { @@ -44,7 +46,7 @@ export const useNostrStore = defineStore("nostr", { this.connected = true; }, initSignerIfNotSet: async function () { - if (!this.signer) { + if (!this.initialized) { await this.initSigner(); } }, @@ -58,6 +60,7 @@ export const useNostrStore = defineStore("nostr", { } else { await this.initWalletSeedPrivateKeySigner(); } + this.initialized = true; }, setSigner: async function (signer: NDKSigner) { this.signer = signer diff --git a/src/stores/npubcash.ts b/src/stores/npubcash.ts index 526c131c..59d135cc 100644 --- a/src/stores/npubcash.ts +++ b/src/stores/npubcash.ts @@ -122,7 +122,8 @@ export const useNPCStore = defineStore("npc", { getInfo: async function (): Promise { const authHeader = await this.generateNip98Event( `${this.baseURL}/api/v1/info`, - "GET" + "GET", + "" ); try { const response = await fetch(`${this.baseURL}/api/v1/info`, {