mirror of
https://github.com/nextcloud/server.git
synced 2026-02-19 02:38:40 -05:00
fix(files): Properly handle files in failed state
When files are loaded from API the `fileid` might be set to `-1` indicating an error on the API. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
c76c954f56
commit
d4352fe2ff
5 changed files with 12 additions and 4 deletions
|
|
@ -16,7 +16,7 @@
|
|||
class="files-list__row"
|
||||
v-on="rowListeners">
|
||||
<!-- Failed indicator -->
|
||||
<span v-if="source.attributes.failed" class="files-list__row--failed" />
|
||||
<span v-if="isFailedSource" class="files-list__row--failed" />
|
||||
|
||||
<!-- Checkbox -->
|
||||
<FileEntryCheckbox :fileid="fileid"
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ import ArrowLeftIcon from 'vue-material-design-icons/ArrowLeft.vue'
|
|||
|
||||
import { useNavigation } from '../../composables/useNavigation'
|
||||
import CustomElementRender from '../CustomElementRender.vue'
|
||||
|
||||
import logger from '../../logger.js'
|
||||
|
||||
// The registered actions list
|
||||
|
|
@ -160,7 +161,7 @@ export default defineComponent({
|
|||
|
||||
// Sorted actions that are enabled for this node
|
||||
enabledActions() {
|
||||
if (this.source.attributes.failed) {
|
||||
if (this.source.status === NodeStatus.FAILED) {
|
||||
return []
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
linkTo() {
|
||||
if (this.source.attributes.failed) {
|
||||
if (this.source.status === NodeStatus.FAILED) {
|
||||
return {
|
||||
is: 'span',
|
||||
params: {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
@dragend="onDragEnd"
|
||||
@drop="onDrop">
|
||||
<!-- Failed indicator -->
|
||||
<span v-if="source.attributes.failed" class="files-list__row--failed" />
|
||||
<span v-if="isFailedSource" class="files-list__row--failed" />
|
||||
|
||||
<!-- Checkbox -->
|
||||
<FileEntryCheckbox :fileid="fileid"
|
||||
|
|
|
|||
|
|
@ -102,6 +102,13 @@ export default defineComponent({
|
|||
return String(this.fileid) === String(this.currentFileId)
|
||||
},
|
||||
|
||||
/**
|
||||
* Check if the source is in a failed state after an API request
|
||||
*/
|
||||
isFailedSource() {
|
||||
return this.source.status === NodeStatus.FAILED
|
||||
},
|
||||
|
||||
canDrag() {
|
||||
if (this.isRenaming) {
|
||||
return false
|
||||
|
|
|
|||
Loading…
Reference in a new issue