From edba3a522a6456850a4aa3b62113c389277a7892 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Thu, 7 Nov 2019 12:07:37 -0800 Subject: [PATCH] Fix View Once Video, fix Permissions Popup * Ensure we're ready to handle incoming View Once messages * Ensure that permissions popup initializes fully --- js/models/conversations.js | 2 +- js/models/messages.js | 6 +++++- permissions_popup_preload.js | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/js/models/conversations.js b/js/models/conversations.js index 283c1daf076f..e19fb58b7823 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -107,7 +107,7 @@ ); this.listenTo( this.messageCollection, - 'add remove destroy', + 'add remove destroy content-changed', this.debouncedUpdateLastMessage ); this.listenTo(this.messageCollection, 'sent', this.updateLastMessage); diff --git a/js/models/messages.js b/js/models/messages.js index 39f5f3230cab..5a4973208c67 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -892,7 +892,10 @@ } const firstAttachment = attachments[0]; - if (!GoogleChrome.isImageTypeSupported(firstAttachment.contentType)) { + if ( + !GoogleChrome.isImageTypeSupported(firstAttachment.contentType) && + !GoogleChrome.isVideoTypeSupported(firstAttachment.contentType) + ) { return false; } @@ -976,6 +979,7 @@ sticker: null, preview: [], }); + this.trigger('content-changed'); await window.Signal.Data.saveMessage(this.attributes, { Message: Whisper.Message, diff --git a/permissions_popup_preload.js b/permissions_popup_preload.js index bf8efc299bde..e3fa7086e4b5 100644 --- a/permissions_popup_preload.js +++ b/permissions_popup_preload.js @@ -10,6 +10,7 @@ const config = url.parse(window.location.toString(), true).query; const { locale } = config; const localeMessages = ipcRenderer.sendSync('locale-data'); +window.getEnvironment = () => config.environment; window.getVersion = () => config.version; window.theme = config.theme; window.i18n = i18n.setup(locale, localeMessages);