firefish/packages/client/src/scripts/get-account-from-id.ts

8 lines
290 B
TypeScript
Raw Normal View History

2023-07-20 04:17:05 +09:00
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);
}