diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-01-03 03:12:37 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-01-10 06:02:37 +0300 |
commit | b9e8a9a3da6ae4a5c76de872045ee501de16c62f (patch) | |
tree | f68a8d2cfb3f67ac28e5e846d9834c6ecd23fd00 | |
parent | d204b09fe04c834fc4997dcf49c40c8b85d151ee (diff) |
Force restoring the sidebar header contents on file changes
If the sidebar is opened in a different file during a call the sidebar
header contents may not be properly restored due to the order in which
the updates are handled, so it needs to be executed again when the
FileInfo has been set and it does not match the current conversation.
Otherwise the call view could be a child of the header instead of the
header actions, so if a call is started again "hidden-by-call" will be
set to the call view too, hiding it during the call.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r-- | src/FilesSidebarCallViewApp.vue | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/FilesSidebarCallViewApp.vue b/src/FilesSidebarCallViewApp.vue index 99f188d47..ec43d3df1 100644 --- a/src/FilesSidebarCallViewApp.vue +++ b/src/FilesSidebarCallViewApp.vue @@ -109,6 +109,38 @@ export default { this.restoreSidebarHeaderContents() } }, + + /** + * Force restoring the sidebar header contents on file changes. + * + * If the sidebar is opened in a different file during a call the + * sidebar header contents may not be properly restored due to the order + * in which the updates are handled, so it needs to be executed again + * when the FileInfo has been set and it does not match the current + * conversation. + * + * @param {Object} fileInfo the watched FileInfo + */ + fileInfo: function(fileInfo) { + if (!fileInfo) { + return + } + + if (this.isInFile) { + return + } + + const headerAction = document.querySelector('.app-sidebar-header__action') + if (!headerAction) { + return + } + + if (this.$el.parentElement === headerAction) { + return + } + + this.restoreSidebarHeaderContents() + }, }, methods: { |