Skip to content

Commit

Permalink
339-clear-cache-on-reload: try clearing cache on reload (#341)
Browse files Browse the repository at this point in the history
* 339-clear-cache-on-reload: try clearing cache on reload

* 339-clear-cache-on-reload: remove cacheStorage handling and add bool parameter to reload

* 339-clear-cache-on-reload: change where is located .reload(true)
  • Loading branch information
aulamber authored Dec 13, 2022
1 parent a9c144a commit 9a12aff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/util/TchapVersionManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class TchapVersionManagement {
static SYNC_STORE_NAME = "matrix-js-sdk:riot-web-sync";

/**
* replicate the behaviour of the button Clear Cache and Reload
* replicate the behaviour of the button Clear Cache and Reload, and clear browser cache on firefox
* https://github.com/matrix-org/matrix-react-sdk/blob/3c5c2bef6dbac51ce6e1864056523815ca4c38d9/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx#L308
* @returns nothing
*/
Expand All @@ -17,7 +17,9 @@ export default class TchapVersionManagement {

MatrixClientPeg.get().stopClient();
MatrixClientPeg.get().store.deleteAllData().then(() => {
PlatformPeg.get().reload();
// The bool parameter of reload() works only in firefox, but most of our users use firefox.
// @ts-expect-error: reload has no official parameter
window.location.reload(true);
});
}

Expand Down

0 comments on commit 9a12aff

Please sign in to comment.