Skip to content

Commit

Permalink
Use NIP-07 extension
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Jan 19, 2024
1 parent d54147b commit 7d1109f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
9 changes: 8 additions & 1 deletion src/logic/mutinyWalletSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,12 @@ export async function setupMutinyWallet(
console.log("No nsec stored");
}
}
let extension_key;
try {
extension_key = await window.nostr.getPublicKey();

Check failure on line 266 in src/logic/mutinyWalletSetup.ts

View workflow job for this annotation

GitHub Actions / Build iOS

Property 'nostr' does not exist on type 'Window & typeof globalThis'.

Check failure on line 266 in src/logic/mutinyWalletSetup.ts

View workflow job for this annotation

GitHub Actions / Build APK

Property 'nostr' does not exist on type 'Window & typeof globalThis'.
} catch (_) {
console.log("No NIP-07 extension")
}

console.log("Initializing Mutiny Manager");
console.log("Using network", network);
Expand Down Expand Up @@ -304,7 +310,8 @@ export async function setupMutinyWallet(
safeMode || undefined,
// Skip hodl invoices? (defaults to true, so if shouldZapHodl is true that's when we pass false)
shouldZapHodl ? false : undefined,
nsec
nsec,

Check failure on line 313 in src/logic/mutinyWalletSetup.ts

View workflow job for this annotation

GitHub Actions / Build iOS

Expected 0-17 arguments, but got 19.

Check failure on line 313 in src/logic/mutinyWalletSetup.ts

View workflow job for this annotation

GitHub Actions / Build APK

Expected 0-17 arguments, but got 19.
extension_key ? extension_key : undefined
);

sessionStorage.setItem("MUTINY_WALLET_INITIALIZED", Date.now().toString());
Expand Down
13 changes: 0 additions & 13 deletions src/routes/settings/SyncNostrContacts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,6 @@ export function SyncNostrContacts() {
}
}

const [hasNsec] = createResource(async () => {
if (Capacitor.isNativePlatform()) {
try {
await SecureStoragePlugin.get({ key: "nsec" });
return true;
} catch (_e) {
return false;
}
} else {
return false;
}
});

async function resync() {
setError(undefined);
setLoading(true);
Expand Down

0 comments on commit 7d1109f

Please sign in to comment.