add network to account

This commit is contained in:
Ren Amamiya
2023-08-04 15:38:38 +07:00
parent 4c7826bbb3
commit 373a0f0608
13 changed files with 103 additions and 89 deletions

View File

@@ -14,8 +14,6 @@ export default class TauriAdapter implements NDKCacheAdapter {
public async query(subscription: NDKSubscription): Promise<void> {
const { filter } = subscription;
// if this filter uses both authors and kinds, then we need to query for each combination of author and kind
// and then combine the results
if (filter.authors && filter.kinds) {
const promises = [];

View File

@@ -63,15 +63,12 @@ export async function createAccount(
}
// update account
export async function updateAccount(
column: string,
value: string | string[],
pubkey: string
) {
export async function updateAccount(column: string, value: string | string[]) {
const db = await connect();
return await db.execute(`UPDATE accounts SET ${column} = ? WHERE pubkey = ?;`, [
const account = await getActiveAccount();
return await db.execute(`UPDATE accounts SET ${column} = ? WHERE id = ?;`, [
value,
pubkey,
account.id,
]);
}