FIX: Clients get stucked in readonly mode if messageBus fails.

This commit is contained in:
Guo Xiang Tan 2018-06-12 12:00:58 +08:00
parent 50b2152ef7
commit c06824e9c2

View File

@ -79,9 +79,12 @@ export function ajax() {
args.success = (data, textStatus, xhr) => {
handleLogoff(xhr);
if (xhr.getResponseHeader('Discourse-Readonly')) {
Ember.run(() => Discourse.Site.currentProp('isReadOnly', true));
}
Ember.run(() => {
Discourse.Site.currentProp(
'isReadOnly',
!!xhr.getResponseHeader('Discourse-Readonly')
);
});
if (args.returnXHR) {
data = { result: data, xhr: xhr };