Skip to content

Commit

Permalink
Merge pull request #4657 from nextcloud/bugfix/noid/viewer-loading-co…
Browse files Browse the repository at this point in the history
…llectives

fix: Properly handle viewer loading in collectives
  • Loading branch information
mejo- authored Aug 9, 2023
2 parents c232edb + 549efef commit 2716cfd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions js/text-viewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-viewer.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/components/ViewerComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
-->

<template>
<Editor v-if="isEditable"
<Editor v-if="!useSourceView"
:file-id="fileid"
:relative-path="filename"
:active="active"
Expand Down Expand Up @@ -96,8 +96,8 @@ export default {
},
computed: {
/** @return {boolean} */
isEditable() {
return this.permissions.includes('W')
useSourceView() {
return this.source && (this.fileVersion || !this.fileid)
},
/** @return {boolean} */
Expand All @@ -118,12 +118,12 @@ export default {
methods: {
async loadFileContent() {
if (!this.isEditable && this.source) {
if (this.useSourceView) {
const response = await axios.get(this.source)
this.content = response.data
this.contentLoaded = true
this.$emit('update:loaded', true)
}
this.$emit('update:loaded', true)
},
},
}
Expand Down

0 comments on commit 2716cfd

Please sign in to comment.