diff --git a/app/assets/javascripts/discourse/routes/application.js.es6 b/app/assets/javascripts/discourse/routes/application.js.es6 index 184646a9ccf..b057bcba8c4 100644 --- a/app/assets/javascripts/discourse/routes/application.js.es6 +++ b/app/assets/javascripts/discourse/routes/application.js.es6 @@ -17,16 +17,16 @@ function unlessReadOnly(method, message) { const ApplicationRoute = Discourse.Route.extend(OpenComposer, { siteTitle: setting('title'), + _handleLogout() { + if (this.currentUser) { + this.currentUser.destroySession().then(() => logout(this.siteSettings, this.keyValueStore)); + } + }, + actions: { logout: unlessReadOnly('_handleLogout', I18n.t("read_only_mode.logout_disabled")), - _handleLogout() { - if (this.currentUser) { - this.currentUser.destroySession().then(() => logout(this.siteSettings, this.keyValueStore)); - } - }, - _collectTitleTokens(tokens) { tokens.push(this.get('siteTitle')); Discourse.set('_docTitle', tokens.join(' - '));