Can change default account

This commit is contained in:
2025-04-08 23:01:43 +02:00
parent 8defd9ad17
commit 8ecb5b79eb
3 changed files with 52 additions and 6 deletions

View File

@ -4,7 +4,7 @@ import { AsyncWidget } from "../widgets/AsyncWidget";
interface AccountContext {
list: AccountsList;
reload: () => void;
reload: () => Promise<void>;
get(id: number): Account | null;
}
@ -24,9 +24,10 @@ export function AccountsListProvider(
};
const onReload = async () => {
loadKey.current += 1;
setList(null);
loadKey.current += 1;
return new Promise<void>((res) => {
loadPromise.current = () => {
res();
@ -36,6 +37,7 @@ export function AccountsListProvider(
return (
<AsyncWidget
ready={list !== null}
loadKey={loadKey.current}
load={load}
errMsg="Failed to load the list of accounts!"