Can change default account
This commit is contained in:
@ -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!"
|
||||
|
Reference in New Issue
Block a user