Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions apps/files/src/views/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,14 @@ export default defineComponent({
},
created() {
subscribe('files:node:deleted', this.onNodeDeleted)
subscribe('files:node:updated', this.onNodeUpdated)

window.addEventListener('resize', this.handleWindowResize)
this.handleWindowResize()
},
beforeDestroy() {
unsubscribe('file:node:deleted', this.onNodeDeleted)
unsubscribe('file:node:deleted', this.onNodeUpdated)
window.removeEventListener('resize', this.handleWindowResize)
},

Expand Down Expand Up @@ -549,6 +551,17 @@ export default defineComponent({
}
},

/**
* Handle if the current node was updated
* @param {import('@nextcloud/files').Node} node The deleted node
*/
onNodeUpdated(node) {
if (this.fileInfo && node && this.fileInfo.id === node.fileid) {
this.close()
this.open(node.path)
}
},

/**
* Allow to set the Sidebar as fullscreen from OCA.Files.Sidebar
*
Expand Down
Loading