This repository was archived by the owner on Apr 21, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed
Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -262,6 +262,16 @@ export async function setupMutinyWallet(
262262 }
263263 }
264264
265+ // if we didn't get an nsec from storage, try to use extension
266+ let extension_key ;
267+ if ( ! nsec ) {
268+ try {
269+ extension_key = await window . nostr . getPublicKey ( ) ;
270+ } catch ( _ ) {
271+ console . log ( "No NIP-07 extension" )
272+ }
273+ }
274+
265275 console . log ( "Initializing Mutiny Manager" ) ;
266276 console . log ( "Using network" , network ) ;
267277 console . log ( "Using proxy" , proxy ) ;
@@ -304,7 +314,8 @@ export async function setupMutinyWallet(
304314 safeMode || undefined ,
305315 // Skip hodl invoices? (defaults to true, so if shouldZapHodl is true that's when we pass false)
306316 shouldZapHodl ? false : undefined ,
307- nsec
317+ nsec ,
318+ extension_key ? extension_key : undefined
308319 ) ;
309320
310321 sessionStorage . setItem ( "MUTINY_WALLET_INITIALIZED" , Date . now ( ) . toString ( ) ) ;
Original file line number Diff line number Diff line change @@ -128,19 +128,6 @@ export function SyncNostrContacts() {
128128 }
129129 }
130130
131- const [ hasNsec ] = createResource ( async ( ) => {
132- if ( Capacitor . isNativePlatform ( ) ) {
133- try {
134- await SecureStoragePlugin . get ( { key : "nsec" } ) ;
135- return true ;
136- } catch ( _e ) {
137- return false ;
138- }
139- } else {
140- return false ;
141- }
142- } ) ;
143-
144131 async function resync ( ) {
145132 setError ( undefined ) ;
146133 setLoading ( true ) ;
You can’t perform that action at this time.
0 commit comments