Skip to content

Commit

Permalink
Make the clear cache button work on desktop
Browse files Browse the repository at this point in the history
Implement reload in Platforms to support
matrix-org/matrix-react-sdk#798

Fixes #3597
  • Loading branch information
dbkr committed Apr 10, 2017
1 parent a1cb566 commit 7f6d9a6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/vector/platform/ElectronPlatform.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,8 @@ export default class ElectronPlatform extends VectorBasePlatform {
requestNotificationPermission() : Promise {
return q('granted');
}

reload() {
electron.remote.getCurrentWebContents().reload();
}
}
6 changes: 6 additions & 0 deletions src/vector/platform/WebPlatform.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,10 @@ export default class WebPlatform extends VectorBasePlatform {
}
return null;
}

reload() {
// forceReload=false since we don't really need new HTML/JS files
// we just need to restart the JS runtime.
window.location.reload(false);
}
}

0 comments on commit 7f6d9a6

Please sign in to comment.