From 4848bef0dd24c628c9e6bcc1ce44f31577328e93 Mon Sep 17 00:00:00 2001 From: morguldir Date: Sat, 17 Sep 2022 09:51:22 +0200 Subject: [PATCH] Add Clear cache and reload button (#793) Inspired by: https://github.com/matrix-org/matrix-react-sdk/blob/3c5c2bef6dbac51ce6e1864056523815ca4c38d9/src/components/views/elements/ErrorBoundary.tsx#L61-L68 Signed-off-by: morguldir Signed-off-by: morguldir --- src/app/organisms/settings/Settings.jsx | 1 + src/client/state/settings.js | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/app/organisms/settings/Settings.jsx b/src/app/organisms/settings/Settings.jsx index 2e0f64bd..8baf589c 100644 --- a/src/app/organisms/settings/Settings.jsx +++ b/src/app/organisms/settings/Settings.jsx @@ -239,6 +239,7 @@ function AboutSection() {
+
diff --git a/src/client/state/settings.js b/src/client/state/settings.js index 32f55fcc..7b9635d3 100644 --- a/src/client/state/settings.js +++ b/src/client/state/settings.js @@ -147,6 +147,14 @@ class Settings extends EventEmitter { return settings.isNotificationSounds; } + clearCacheAndReload() { + const mx = initMatrix.matrixClient; + mx.stopClient() + mx.store.deleteAllData().then(() => { + window.location.reload(); + }); +} + setter(action) { const actions = { [cons.actions.settings.TOGGLE_SYSTEM_THEME]: () => {