Skip to content

Commit

Permalink
Push reload in foreground if on page or in chat
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscant committed Jul 22, 2018
1 parent 1118a04 commit 68ee7fb
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions http/js/iznik/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,17 @@ function mainOnAppStart() { // CC
})(10);
}
}
if (foreground) {
var frag = Backbone.history.getFragment();
console.log("frag", frag);
if (foreground) { // Reload if route matches where we are - or if on any chat screen eg /chat/123456 or /chats
var frag = '/' + Backbone.history.getFragment();
if (data.additionalData.route) {
console.log("data.additionalData.route", data.additionalData.route);
if (frag == data.additionalData.route) {
Backbone.history.loadUrl();
}
else {
if ((frag.substring(0, 5) == '/chat') && (data.additionalData.route.substring(0, 5) == '/chat')) {
Backbone.history.loadUrl(); // refresh rather than go to route
}
}
}
}

Expand Down

0 comments on commit 68ee7fb

Please sign in to comment.