mirror of https://github.com/zulip/zulip.git
Immediately load_old_messages when the user arrives via a #narrow URL
(imported from commit 9705cbb70f9ce62ea5e362212ac91daf1b97ff13)
This commit is contained in:
parent
8b56de22e0
commit
ff57c9af59
|
@ -20,13 +20,14 @@ exports.changehash = function (newhash) {
|
|||
}
|
||||
};
|
||||
|
||||
// Returns true if this function performed a narrow
|
||||
function hashchanged() {
|
||||
// If window.location.hash changed because our app explicitly
|
||||
// changed it, then we don't need to do anything.
|
||||
// (This function only neds to jump into action if it changed
|
||||
// because e.g. the back button was pressed by the user)
|
||||
if (window.location.hash === expected_hash) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
var hash = window.location.hash.split("/");
|
||||
|
@ -35,7 +36,7 @@ function hashchanged() {
|
|||
ui.change_tab_to("#home");
|
||||
narrow.hashchanged(hash);
|
||||
ui.update_floating_recipient_bar();
|
||||
break;
|
||||
return true;
|
||||
case "":
|
||||
case "#":
|
||||
ui.change_tab_to("#home");
|
||||
|
@ -49,11 +50,14 @@ function hashchanged() {
|
|||
ui.change_tab_to("#settings");
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
exports.initialize = function () {
|
||||
window.onhashchange = hashchanged;
|
||||
hashchanged();
|
||||
if (hashchanged()) {
|
||||
load_more_messages();
|
||||
}
|
||||
};
|
||||
|
||||
return exports;
|
||||
|
|
Loading…
Reference in New Issue