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

Backport pull request #5636 from jellyfin-web/release-10.9.z

Clear query and view cache on user logout

Original-merge: 4129676ed8

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

Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
grafixeyehero 2024-06-01 18:42:06 -04:00 committed by Joshua M. Boniface
parent 7e0afdfd66
commit 1fc471a0ed
2 changed files with 6 additions and 6 deletions

View file

@ -12,6 +12,8 @@ import DirectoryBrowser from '../components/directorybrowser/directorybrowser';
import dialogHelper from '../components/dialogHelper/dialogHelper';
import itemIdentifier from '../components/itemidentifier/itemidentifier';
import { getLocationSearch } from './url.ts';
import { queryClient } from './query/queryClient';
import viewContainer from 'components/viewContainer';
export function getCurrentUser() {
return window.ApiClient.getCurrentUser(false);
@ -98,6 +100,10 @@ export function onServerChanged(_userId, _accessToken, apiClient) {
export function logout() {
ServerConnections.logout().then(function () {
// Clear the query cache
queryClient.clear();
// Reset cached views
viewContainer.reset();
webSettings.getMultiServer().then(multi => {
multi ? navigate('selectserver.html') : navigate('login.html');
});