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(
262
262
}
263
263
}
264
264
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
+
265
275
console . log ( "Initializing Mutiny Manager" ) ;
266
276
console . log ( "Using network" , network ) ;
267
277
console . log ( "Using proxy" , proxy ) ;
@@ -304,7 +314,8 @@ export async function setupMutinyWallet(
304
314
safeMode || undefined ,
305
315
// Skip hodl invoices? (defaults to true, so if shouldZapHodl is true that's when we pass false)
306
316
shouldZapHodl ? false : undefined ,
307
- nsec
317
+ nsec ,
318
+ extension_key ? extension_key : undefined
308
319
) ;
309
320
310
321
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() {
128
128
}
129
129
}
130
130
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
-
144
131
async function resync ( ) {
145
132
setError ( undefined ) ;
146
133
setLoading ( true ) ;
You can’t perform that action at this time.
0 commit comments