diff --git a/js/background.js b/js/background.js index efaa97cae..affb8ef3d 100644 --- a/js/background.js +++ b/js/background.js @@ -19,7 +19,7 @@ ;(function() { 'use strict'; - const { Attachment } = window.Whisper; + const { Attachment } = window.Whisper.Types; // Implicitly used in `indexeddb-backbonejs-adapter`: // https://github.com/signalapp/Signal-Desktop/blob/4033a9f8137e62ed286170ed5d4941982b1d3a64/components/indexeddb-backbonejs-adapter/backbone-indexeddb.js#L569 diff --git a/js/models/conversations.js b/js/models/conversations.js index 1f19fae7c..4e3534984 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -10,7 +10,7 @@ 'use strict'; window.Whisper = window.Whisper || {}; - const { Attachment } = window.Whisper; + const { Attachment } = window.Whisper.Types; // TODO: Factor out private and group subclasses of Conversation diff --git a/js/views/file_input_view.js b/js/views/file_input_view.js index eaa5389cf..aeae9607d 100644 --- a/js/views/file_input_view.js +++ b/js/views/file_input_view.js @@ -9,8 +9,6 @@ 'use strict'; window.Whisper = window.Whisper || {}; - const {Attachment} = window.Whisper; - Whisper.FileSizeToast = Whisper.ToastView.extend({ templateName: 'file-size-modal', render_attributes: function() { diff --git a/preload.js b/preload.js index 587ed4a89..c74e7f62c 100644 --- a/preload.js +++ b/preload.js @@ -77,7 +77,8 @@ // ES2015+ modules window.Whisper = window.Whisper || {}; - window.Whisper.Attachment = require('./js/modules/types/attachment'); + window.Whisper.Types = window.Whisper.Types || {}; + window.Whisper.Types.Attachment = require('./js/modules/types/attachment'); // We pull this in last, because the native module involved appears to be sensitive to // /tmp mounted as noexec on Linux.