Skip to content

Commit

Permalink
fix: Properly handle viewer loading in collectives
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr authored and mejo- committed Aug 9, 2023
1 parent ba73e7e commit ceefe5f
Showing 1 changed file with 5 additions and 5 deletions.
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 ceefe5f

Please sign in to comment.