Merge pull request #219 from jnugh/forceReload

Workaround: Invalidate cache of the main page on load
This commit is contained in:
Yuya Ochiai
2016-08-13 10:50:25 +09:00
committed by GitHub
2 changed files with 10 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ Release date: TBD
- Changed display of unread messages on the team tabbar, they are now shown as bold text
- Reload only the selected tab and keep its URL on "Reload" and "Clear Cache and Reload".
- Disabled `eval()` function for security improvements.
- Invalidate cache before load, to make server upgrades easy
#### Windows
- Update Mattermost icon for desktop notifications in Windows 10.

View File

@@ -312,7 +312,8 @@ var MattermostView = React.createClass({
webview.addEventListener('did-fail-load', function(e) {
console.log(thisObj.props.name, 'webview did-fail-load', e);
if (e.errorCode === -3) { // An operation was aborted (due to user action).
if (e.errorCode === -3 || // An operation was aborted (due to user action).
e.errorCode === -300) { //The operation was aborted to invalidate application cache
return;
}
@@ -349,6 +350,13 @@ var MattermostView = React.createClass({
}
});
webview.addEventListener("did-start-loading", function() {
if (!webview.cacheInvalidated) {
webview.reloadIgnoringCache();
webview.cacheInvalidated = true;
}
});
webview.addEventListener("dom-ready", function() {
// webview.openDevTools();