diff --git a/frontend/src/components/TopBar.tsx b/frontend/src/components/TopBar.tsx index cc36dc05..8a148b96 100644 --- a/frontend/src/components/TopBar.tsx +++ b/frontend/src/components/TopBar.tsx @@ -10,7 +10,7 @@ // limitations under the License. import React, {useMemo} from 'react' -import {useState, setState} from '../store' +import {useState, setState, clearAllState} from '../store' import {LoadInitialState} from '../model' // UI Elements @@ -118,6 +118,7 @@ export default function Topbar() { let newRegion = region.detail.id setState(['app', 'selectedRegion'], newRegion) clearClusterOnRegionChange(location.pathname, navigate) + clearAllState() LoadInitialState() queryClient.invalidateQueries() } diff --git a/frontend/src/model.tsx b/frontend/src/model.tsx index 1114d24f..05b79935 100644 --- a/frontend/src/model.tsx +++ b/frontend/src/model.tsx @@ -9,13 +9,7 @@ // OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and // limitations under the License. import {ClusterInfoSummary} from './types/clusters' -import { - clearAllState, - clearState, - getState, - setState, - updateState, -} from './store' +import {clearState, getState, setState, updateState} from './store' import {generateRandomId} from './util' // UI Elements @@ -888,7 +882,6 @@ async function GetAppConfig() { async function LoadInitialState() { const region = getState(['app', 'selectedRegion']) clearState(['app', 'aws']) - clearAllState() GetVersion() await GetAppConfig() GetIdentity(_ => {