diff --git a/app/assets/javascripts/discourse/app/components/modal/history.js b/app/assets/javascripts/discourse/app/components/modal/history.js index a7aa1930094..bf1ce2b42e4 100644 --- a/app/assets/javascripts/discourse/app/components/modal/history.js +++ b/app/assets/javascripts/discourse/app/components/modal/history.js @@ -28,7 +28,7 @@ export default class History extends Component { @tracked loading; @tracked postRevision; - @tracked viewMode = this.site?.mobileView ? "inline" : "side_by_side"; + @tracked viewMode = this.site.mobileView ? "inline" : "side_by_side"; @tracked bodyDiff; @tracked initialLoad = true; diff --git a/app/assets/javascripts/discourse/app/lib/uppy/uppy-upload.js b/app/assets/javascripts/discourse/app/lib/uppy/uppy-upload.js index 53cc1fff20c..41184881346 100644 --- a/app/assets/javascripts/discourse/app/lib/uppy/uppy-upload.js +++ b/app/assets/javascripts/discourse/app/lib/uppy/uppy-upload.js @@ -465,7 +465,7 @@ export default class UppyUpload { #xhrUploadUrl() { const uploadUrl = this.config.uploadUrl || this.config.uploadRootPath; - return getUrl(uploadUrl) + ".json?client_id=" + this.messageBus?.clientId; + return getUrl(uploadUrl) + ".json?client_id=" + this.messageBus.clientId; } #bindFileInputChange() { diff --git a/plugins/chat/assets/javascripts/discourse/services/chat-drafts-manager.js b/plugins/chat/assets/javascripts/discourse/services/chat-drafts-manager.js index b7b7efcdfd6..48449fc9563 100644 --- a/plugins/chat/assets/javascripts/discourse/services/chat-drafts-manager.js +++ b/plugins/chat/assets/javascripts/discourse/services/chat-drafts-manager.js @@ -7,7 +7,8 @@ export default class ChatDraftsManager extends Service { drafts = {}; willDestroy() { - cancel(this?._persistHandler); + super.willDestroy(...arguments); + cancel(this._persistHandler); } async add(message, channelId, threadId) { diff --git a/plugins/chat/assets/javascripts/discourse/services/chat-guardian.js b/plugins/chat/assets/javascripts/discourse/services/chat-guardian.js index 7f50095e4ec..cdd43556fdd 100644 --- a/plugins/chat/assets/javascripts/discourse/services/chat-guardian.js +++ b/plugins/chat/assets/javascripts/discourse/services/chat-guardian.js @@ -18,8 +18,6 @@ export default class ChatGuardian extends Service { } canUseChat() { - return ( - this.currentUser?.has_chat_enabled && this.siteSettings?.chat_enabled - ); + return this.currentUser?.has_chat_enabled && this.siteSettings.chat_enabled; } }