reload state on sign in (#539)
This commit is contained in:
committed by
GitHub
parent
6fb7b939d9
commit
b35073ae77
@@ -22,7 +22,7 @@ export function GitHubLoginDialog({
|
|||||||
open: boolean;
|
open: boolean;
|
||||||
onOpenChange: (open: boolean) => void;
|
onOpenChange: (open: boolean) => void;
|
||||||
}) {
|
}) {
|
||||||
const { config, loading, githubTokenInvalid } = useConfig();
|
const { config, loading, githubTokenInvalid, reloadSystem } = useConfig();
|
||||||
const [fetching, setFetching] = useState(false);
|
const [fetching, setFetching] = useState(false);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
const [deviceState, setDeviceState] =
|
const [deviceState, setDeviceState] =
|
||||||
@@ -62,6 +62,7 @@ export function GitHubLoginDialog({
|
|||||||
setPolling(false);
|
setPolling(false);
|
||||||
setDeviceState(null);
|
setDeviceState(null);
|
||||||
setError(null);
|
setError(null);
|
||||||
|
await reloadSystem();
|
||||||
onOpenChange(false);
|
onOpenChange(false);
|
||||||
break;
|
break;
|
||||||
case DevicePollStatus.AUTHORIZATION_PENDING:
|
case DevicePollStatus.AUTHORIZATION_PENDING:
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ export function useConfig() {
|
|||||||
updateAndSaveConfig,
|
updateAndSaveConfig,
|
||||||
loading,
|
loading,
|
||||||
githubTokenInvalid,
|
githubTokenInvalid,
|
||||||
|
reloadSystem,
|
||||||
} = useUserSystem();
|
} = useUserSystem();
|
||||||
return {
|
return {
|
||||||
config,
|
config,
|
||||||
@@ -212,6 +213,7 @@ export function useConfig() {
|
|||||||
updateAndSaveConfig,
|
updateAndSaveConfig,
|
||||||
loading,
|
loading,
|
||||||
githubTokenInvalid,
|
githubTokenInvalid,
|
||||||
|
reloadSystem,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user