summaryrefslogtreecommitdiff
path: root/packages/client/src/scripts/get-account-from-id.ts
blob: ba3adceeccd99cfb8b54e96c490d8685d46c0d61 (plain)
1
2
3
4
5
6
7
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(e => e.id === id);
}