mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
FEATURE: better UX when backing-up the site
Users won't be prompted whenever the site goes into read-only mode. Instead, a banner will be shown at the top of every pages. Also, the browser won't automatically reload whenever read-only mode is disabled. This really was bad UX.
This commit is contained in:
parent
67463af4f4
commit
5e1019adba
@ -26,18 +26,10 @@ Discourse.addInitializer(function() {
|
||||
|
||||
});
|
||||
|
||||
// initialize read-only mode and subscribe to updates via the message bus
|
||||
Discourse.set("isReadOnly", Discourse.Site.currentProp("is_readonly"));
|
||||
|
||||
Discourse.MessageBus.subscribe("/site/read-only", function (enabled) {
|
||||
Discourse.set("isReadOnly", enabled);
|
||||
if (enabled) {
|
||||
if (!Discourse.User.currentProp("hideReadOnlyAlert")) {
|
||||
bootbox.alert(I18n.t("read_only_mode.enabled"));
|
||||
}
|
||||
} else {
|
||||
// force a reload
|
||||
document.location.reload();
|
||||
}
|
||||
});
|
||||
|
||||
Discourse.KeyValueStore.init("discourse_", Discourse.MessageBus);
|
||||
|
Loading…
x
Reference in New Issue
Block a user