Workaround for bad cache handling in mattermost platform, fixes #212

This commit is contained in:
Jonas Schwabe
2016-07-22 07:36:45 +02:00
parent eac17decf6
commit 61bf5344bf

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).
webview.cacheInvalidated) { //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();