Skip to content

Commit

Permalink
Merge pull request #6569 from owncloud/fix-resize-observer-warnings
Browse files Browse the repository at this point in the history
Fix resize observer errors within subfolders of a space
  • Loading branch information
Pascal Wengerter authored Mar 10, 2022
2 parents e89b617 + 5dc6a94 commit 51ce009
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/bugfix-resize-observer-errors
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Resize observer errors within subfolders of a space

We've fixed a bug where the resize observer crashes within subfolders of a space because there is no element to observe.

https://github.com/owncloud/web/pull/6569
12 changes: 7 additions & 5 deletions packages/web-app-files/src/views/spaces/Project.vue
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,13 @@ export default {
if ((!sameRoute || !sameItem) && from) {
this.loadResourcesTask.perform(this, sameRoute, to.params.item)
}
if (this.$refs.markdownContainer) {
if (this.markdownResizeObserver) {
this.markdownResizeObserver.unobserve(this.$refs.markdownContainer)
}
this.markdownResizeObserver.observe(this.$refs.markdownContainer)
}
},
immediate: true
},
Expand Down Expand Up @@ -382,11 +389,6 @@ export default {
async mounted() {
await this.loadResourcesTask.perform(this, false, this.$route.params.item || '')
if (this.markdownResizeObserver) {
this.markdownResizeObserver.unobserve(this.$refs.markdownContainer)
}
this.markdownResizeObserver.observe(this.$refs.markdownContainer)
document.title = `${this.space.name} - ${this.$route.meta.title}`
this.$route.params.name = this.space.name
Expand Down

0 comments on commit 51ce009

Please sign in to comment.