wip: multi-type composer
This commit is contained in:
@@ -68,8 +68,6 @@ export const NDKInstance = () => {
|
||||
// Privkey Signer
|
||||
const userPrivkey = await db.secureLoad(db.account.pubkey);
|
||||
if (userPrivkey) return new NDKPrivateKeySigner(userPrivkey);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
async function initNDK() {
|
||||
@@ -87,9 +85,13 @@ export const NDKInstance = () => {
|
||||
try {
|
||||
// connect
|
||||
await instance.connect(2000);
|
||||
|
||||
// add signer
|
||||
const signer = await getSigner(instance);
|
||||
instance.signer = signer;
|
||||
|
||||
// update account's metadata
|
||||
// todo
|
||||
} catch (error) {
|
||||
await message(`NDK instance init failed: ${error}`, {
|
||||
title: 'Lume',
|
||||
|
||||
@@ -23,9 +23,13 @@ export class LumeStorage {
|
||||
}
|
||||
|
||||
public async secureLoad(key: string) {
|
||||
const value: string = await invoke('secure_load', { key });
|
||||
if (!value) return null;
|
||||
return value;
|
||||
try {
|
||||
const value: string = await invoke('secure_load', { key });
|
||||
if (!value) return null;
|
||||
return value;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public async secureRemove(key: string) {
|
||||
|
||||
Reference in New Issue
Block a user