1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Backport pull request #6388 from jellyfin-web/release-10.10.z

Fix async route page refresh not loading header

Original-merge: 3d20694109

Merged-by: thornbill <thornbill@users.noreply.github.com>

Backported-by: thornbill <thornbill@users.noreply.github.com>
This commit is contained in:
viown 2025-01-22 03:12:43 -05:00 committed by thornbill
parent cbc356ebdc
commit ddb01f2e0d
2 changed files with 18 additions and 17 deletions

View file

@ -150,21 +150,25 @@ const ConnectionRequired: FunctionComponent<ConnectionRequiredProps> = ({
useEffect(() => {
// Check connection status on initial page load
const apiClient = ServerConnections.currentApiClient();
const firstConnection = ServerConnections.firstConnection;
console.debug('[ConnectionRequired] connection state', firstConnection?.State);
ServerConnections.firstConnection = null;
const connection = Promise.resolve(ServerConnections.firstConnection ? null : ServerConnections.connect());
connection.then(firstConnection => {
console.debug('[ConnectionRequired] connection state', firstConnection?.State);
ServerConnections.firstConnection = true;
if (firstConnection && firstConnection.State !== ConnectionState.SignedIn && !apiClient?.isLoggedIn()) {
handleIncompleteWizard(firstConnection)
.catch(err => {
console.error('[ConnectionRequired] could not start wizard', err);
});
} else {
validateUserAccess()
.catch(err => {
console.error('[ConnectionRequired] could not validate user access', err);
});
}
if (firstConnection && firstConnection.State !== ConnectionState.SignedIn && !apiClient?.isLoggedIn()) {
handleIncompleteWizard(firstConnection)
.catch(err => {
console.error('[ConnectionRequired] could not start wizard', err);
});
} else {
validateUserAccess()
.catch(err => {
console.error('[ConnectionRequired] could not validate user access', err);
});
}
}).catch(err => {
console.error('[ConnectionRequired] failed to connect', err);
});
}, [handleIncompleteWizard, validateUserAccess]);
if (isLoading) {