From 2721b2a477b5881109bc145841d098ff060e4119 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 30 Jan 2020 11:39:46 +1100 Subject: [PATCH] refresh files in group in group panel --- js/views/conversation_view.js | 9 ++++++--- ts/components/session/SessionChannelSettings.tsx | 12 ++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index c6fd292a8..6d90fd71d 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -350,7 +350,12 @@ props: getGroupSettingsProp(this.model), }); this.$('.conversation-content-right').append(this.groupSettings.el); + this.$('.conversation-content-right').show(); + + return; } + + this.groupSettings.update(getGroupSettingsProp(this.model)); this.$('.conversation-content-right').show(); }; @@ -875,9 +880,7 @@ }, updateScrollDownButton(count) { - if (this.scrollDownButton) { - this.scrollDownButton.increment(count); - } else { + if (!this.scrollDownButton) { this.scrollDownButton = new Whisper.ScrollDownButtonView({ count }); this.scrollDownButton.render(); const container = this.$('.discussion-container'); diff --git a/ts/components/session/SessionChannelSettings.tsx b/ts/components/session/SessionChannelSettings.tsx index f7462ceaa..f775d84e8 100644 --- a/ts/components/session/SessionChannelSettings.tsx +++ b/ts/components/session/SessionChannelSettings.tsx @@ -49,6 +49,18 @@ export class SessionChannelSettings extends React.Component { .ignore(); } + public componentDidUpdate() { + this.getMediaGalleryProps() + .then(({ documents, media, onItemClick }) => { + this.setState({ + documents, + media, + onItemClick, + }); + }) + .ignore(); + } + public async getMediaGalleryProps() { // We fetch more documents than media as they don’t require to be loaded // into memory right away. Revisit this once we have infinite scrolling: