Skip to content

Commit fed2b51

Browse files
committed
fix(keys): ensure signer is ready before key init
1 parent 99f4f62 commit fed2b51

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hooks/useInventoryKey.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ export function useInventoryKey() {
192192
});
193193
}
194194

195-
if (activeUser && !isLoadingKeychains && !isLoadingKeys && !myKey && !initializeKey.isPending) {
195+
if (activeUser && ndk?.signer && !isLoadingKeychains && !isLoadingKeys && !myKey && !initializeKey.isPending) {
196196
console.log('Auto-initializing inventory key (NIP-44 Upgrade or Missing Key)');
197197
initializeKey.mutate();
198198
}
199-
}, [activeUser, isLoadingKeychains, isLoadingKeys, myKey, initializeKey.isPending]);
199+
}, [activeUser, ndk?.signer, isLoadingKeychains, isLoadingKeys, myKey, initializeKey.isPending]);
200200

201201
return {
202202
keys,

0 commit comments

Comments
 (0)