wip: multi-type composer

This commit is contained in:
2023-10-21 15:58:39 +07:00
parent de88ca51fe
commit cade8c8b4c
16 changed files with 234 additions and 36 deletions

View File

@@ -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',

View File

@@ -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) {