From f0c43418da4470a29c256e9a4a8b03268b48eb90 Mon Sep 17 00:00:00 2001 From: thornbill Date: Sat, 25 May 2024 11:50:52 -0400 Subject: [PATCH] Backport pull request #5600 from jellyfin-web/release-10.9.z Reset query cache on user logout Original-merge: a88d03fe8f61706b55dacf2d509c1abff361e823 Merged-by: thornbill Backported-by: Joshua M. Boniface --- src/components/ServerConnections.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/ServerConnections.js b/src/components/ServerConnections.js index 93aff18584..c46a492856 100644 --- a/src/components/ServerConnections.js +++ b/src/components/ServerConnections.js @@ -6,6 +6,7 @@ import Dashboard from '../utils/dashboard'; import Events from '../utils/events.ts'; import { setUserInfo } from '../scripts/settings/userSettings'; import appSettings from '../scripts/settings/appSettings'; +import { queryClient } from 'utils/query/queryClient'; const normalizeImageOptions = options => { if (!options.quality && (options.maxWidth || options.width || options.maxHeight || options.height || options.fillWidth || options.fillHeight)) { @@ -41,6 +42,8 @@ class ServerConnections extends ConnectionManager { setUserInfo(null, null); // Ensure the updated credentials are persisted to storage credentialProvider.credentials(credentialProvider.credentials()); + // Reset the query cache + queryClient.resetQueries(); if (window.NativeShell && typeof window.NativeShell.onLocalUserSignedOut === 'function') { window.NativeShell.onLocalUserSignedOut(logoutInfo);