Merge pull request #798 from matrix-org/dbkr/clear_cache_button_electron

Make the clear cache button work on desktop
This commit is contained in:
David Baker 2017-04-10 17:56:59 +01:00 committed by GitHub
commit 95dfbc5546
2 changed files with 11 additions and 3 deletions

View file

@ -82,4 +82,12 @@ export default class BasePlatform {
screenCaptureErrorString() {
return "Not implemented";
}
/**
* Restarts the application, without neccessarily reloading
* any application code
*/
reload() {
throw new Error("reload not implemented!");
}
}

View file

@ -441,10 +441,10 @@ module.exports = React.createClass({
},
_onClearCacheClicked: function() {
if (!PlatformPeg.get()) return;
MatrixClientPeg.get().store.deleteAllData().done(() => {
// forceReload=false since we don't really need new HTML/JS files
// we just need to restart the JS runtime.
window.location.reload(false);
PlatformPeg.get().reload();
});
},