1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-18 08:38:45 +09:00
cherrypick/packages/frontend/src/scripts/get-account-from-id.ts
2022-12-27 14:36:33 +09:00

8 lines
287 B
TypeScript

import { get } from '@/scripts/idb-proxy';
export async function getAccountFromId(id: string) {
const accounts = await get('accounts') as { token: string; id: string; }[];
if (!accounts) console.log('Accounts are not recorded');
return accounts.find(account => account.id === id);
}