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;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
}) {
|
||||
const { config, loading, githubTokenInvalid } = useConfig();
|
||||
const { config, loading, githubTokenInvalid, reloadSystem } = useConfig();
|
||||
const [fetching, setFetching] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [deviceState, setDeviceState] =
|
||||
@@ -62,6 +62,7 @@ export function GitHubLoginDialog({
|
||||
setPolling(false);
|
||||
setDeviceState(null);
|
||||
setError(null);
|
||||
await reloadSystem();
|
||||
onOpenChange(false);
|
||||
break;
|
||||
case DevicePollStatus.AUTHORIZATION_PENDING:
|
||||
|
||||
@@ -204,6 +204,7 @@ export function useConfig() {
|
||||
updateAndSaveConfig,
|
||||
loading,
|
||||
githubTokenInvalid,
|
||||
reloadSystem,
|
||||
} = useUserSystem();
|
||||
return {
|
||||
config,
|
||||
@@ -212,6 +213,7 @@ export function useConfig() {
|
||||
updateAndSaveConfig,
|
||||
loading,
|
||||
githubTokenInvalid,
|
||||
reloadSystem,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user