mirror of
https://github.com/discourse/discourse.git
synced 2025-02-22 12:17:12 +00:00
FIX: Ensure page is reloaded correctly when a hash is present (#8096)
To demonstrate the issue: - Visit https://meta.discourse.org/#somethingHere while logged in - Click "log out" - You will be logged out, but the page will not be reloaded Setting `window.location.pathname = "/"` will not reload the page if there is a hash present. Using `window.location = "/"` gives us the desired behavior.
This commit is contained in:
parent
e0a403edfc
commit
39f7e98b60
@ -63,7 +63,7 @@ Backup.reopenClass({
|
|||||||
bootbox.alert(result.message);
|
bootbox.alert(result.message);
|
||||||
} else {
|
} else {
|
||||||
// redirect to homepage (session might be lost)
|
// redirect to homepage (session might be lost)
|
||||||
window.location.pathname = Discourse.getURL("/");
|
window.location = Discourse.getURL("/");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ export default Discourse.Route.extend({
|
|||||||
);
|
);
|
||||||
if (log.operation === "restore") {
|
if (log.operation === "restore") {
|
||||||
// redirect to homepage when the restore is done (session might be lost)
|
// redirect to homepage when the restore is done (session might be lost)
|
||||||
window.location.pathname = Discourse.getURL("/");
|
window.location = Discourse.getURL("/");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.controllerFor("adminBackupsLogs")
|
this.controllerFor("adminBackupsLogs")
|
||||||
|
@ -349,7 +349,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||||||
$.removeCookie("destination_url");
|
$.removeCookie("destination_url");
|
||||||
window.location.href = destinationUrl;
|
window.location.href = destinationUrl;
|
||||||
} else if (window.location.pathname === Discourse.getURL("/login")) {
|
} else if (window.location.pathname === Discourse.getURL("/login")) {
|
||||||
window.location.pathname = Discourse.getURL("/");
|
window.location = Discourse.getURL("/");
|
||||||
} else {
|
} else {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
@ -190,7 +190,7 @@ export default Ember.Controller.extend(
|
|||||||
() => {
|
() => {
|
||||||
bootbox.alert(
|
bootbox.alert(
|
||||||
I18n.t("user.deleted_yourself"),
|
I18n.t("user.deleted_yourself"),
|
||||||
() => (window.location.pathname = Discourse.getURL("/"))
|
() => (window.location = Discourse.getURL("/"))
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
@ -238,7 +238,7 @@ export default Ember.Controller.extend(
|
|||||||
if (!token) {
|
if (!token) {
|
||||||
const redirect = this.siteSettings.logout_redirect;
|
const redirect = this.siteSettings.logout_redirect;
|
||||||
if (Ember.isEmpty(redirect)) {
|
if (Ember.isEmpty(redirect)) {
|
||||||
window.location.pathname = Discourse.getURL("/");
|
window.location = Discourse.getURL("/");
|
||||||
} else {
|
} else {
|
||||||
window.location.href = redirect;
|
window.location.href = redirect;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ export default function logout(siteSettings, keyValueStore) {
|
|||||||
|
|
||||||
const redirect = siteSettings.logout_redirect;
|
const redirect = siteSettings.logout_redirect;
|
||||||
if (Ember.isEmpty(redirect)) {
|
if (Ember.isEmpty(redirect)) {
|
||||||
window.location.pathname = Discourse.getURL("/");
|
window.location = Discourse.getURL("/");
|
||||||
} else {
|
} else {
|
||||||
window.location.href = redirect;
|
window.location.href = redirect;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user