Skip to content
Permalink
Browse files

Apply fix for web ui redirection

  • Loading branch information...
pwnbus committed Oct 24, 2019
1 parent b822b1a commit 329d80c932d82a48cde3724e6cf37cd3d35f57b0
Showing with 5 additions and 1 deletion.
  1. +5 −1 meteor/client/layout.js
@@ -10,6 +10,10 @@ import { Session } from 'meteor/session';
import { Tracker } from 'meteor/tracker';

if (Meteor.isClient) {
let pageIsUnloading = false;
document.addEventListener('readystatechange', event => {
pageIsUnloading = true;
});
//events that could fire in any sub template
Template.layout.events({
"click .ipmenu-copy": function(e,t){
@@ -77,7 +81,7 @@ if (Meteor.isClient) {
// Verify a user is actually logged in and Meteor is running
if ((Meteor.user() !== null) && (Meteor.status().connected)) {
// Status 0 means the request failed (CORS denies access)
if (xhrInstance.readyState == 4 && (xhrInstance.status == 302 || xhrInstance.status == 0)) {
if (xhrInstance.readyState == 4 && (xhrInstance.status == 302 || xhrInstance.status == 0) && !pageIsUnloading) {
location.reload();
}
}

0 comments on commit 329d80c

Please sign in to comment.
You can’t perform that action at this time.