reload state on sign in (#539)

This commit is contained in:
Gabriel Gordon-Hall
2025-08-20 16:27:52 +01:00
committed by GitHub
parent 6fb7b939d9
commit b35073ae77
2 changed files with 4 additions and 1 deletions

View File

@@ -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:

View File

@@ -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,
}; };
} }