Files
misskey/src/client/scripts/get-account-from-id.ts
tamaina bf1db27824 ✌️
2021-02-15 06:05:18 +09:00

8 lines
274 B
TypeScript

import { get } from 'idb-keyval';
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)
}