/* * SPDX-FileCopyrightText: syuilo and misskey-project * SPDX-License-Identifier: AGPL-3.0-only */ import { get } from 'idb-keyval'; import * as Misskey from 'misskey-js'; export async function getAccountFromId(id: string): Promise | undefined> { const accounts = await get[]>('accounts'); if (!accounts) { console.log('Accounts are not recorded'); return; } return accounts.find(e => e.id === id); }