Skip to content

Commit

Permalink
Handle the case where the sidebar is reused when switching contexts
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
  • Loading branch information
Pytal committed Jun 10, 2022
1 parent 948ef4f commit 91567d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/comments/src/comments-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ const commentTab = new OCA.Files.Sidebar.Tab({
TabInstance.active(fileInfo.id)
},
update(fileInfo) {
// Run active handler on sidebar update when switching between file/folder contexts
if (OCA.Files.Sidebar.state.activeTab === tabId) {
TabInstance.active(fileInfo.id)
}
TabInstance.update(fileInfo.id)
},
destroy() {
Expand Down

0 comments on commit 91567d7

Please sign in to comment.