Backport pull request #5636 from jellyfin-web/release-10.9.z
Clear query and view cache on user logout Original-merge: 4129676ed896e094351b3eb188fece8b5a1eaba7 Merged-by: thornbill <thornbill@users.noreply.github.com> Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
committed by
Joshua M. Boniface
parent
7e0afdfd66
commit
1fc471a0ed
@@ -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');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user