aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/components/FileEntry
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-05-31 14:19:12 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-06-08 15:58:45 +0200
commit13d9a1007b40310b4e6cd3abec892dbf266c602d (patch)
tree842f195c914887fc17cd14a6020d40e82a1df0ee /apps/files/src/components/FileEntry
parent7004c3cb46e58d0545adafcfe7386ac7f79ec16b (diff)
downloadnextcloud-server-13d9a1007b40310b4e6cd3abec892dbf266c602d.tar.gz
nextcloud-server-13d9a1007b40310b4e6cd3abec892dbf266c602d.zip
refactor(files): Fix TypeScript issues in FileEntryActions
* We filter the array in `enabledSubmenuActions` so we can be sure the action does have a parent * Node attributes must be accessed using the `attributes` getter not the private `_attributes` property * Cast action ref to correct component interface to make TypeScript happy Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files/src/components/FileEntry')
-rw-r--r--apps/files/src/components/FileEntry/FileEntryActions.vue10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/files/src/components/FileEntry/FileEntryActions.vue b/apps/files/src/components/FileEntry/FileEntryActions.vue
index cc9413cf413..21d5cd9e796 100644
--- a/apps/files/src/components/FileEntry/FileEntryActions.vue
+++ b/apps/files/src/components/FileEntry/FileEntryActions.vue
@@ -211,12 +211,12 @@ export default defineComponent({
return this.enabledActions
.filter(action => action.parent)
.reduce((arr, action) => {
- if (!arr[action.parent]) {
- arr[action.parent] = []
+ if (!arr[action.parent!]) {
+ arr[action.parent!] = []
}
- arr[action.parent].push(action)
+ arr[action.parent!].push(action)
return arr
- }, {} as Record<string, FileAction>)
+ }, {} as Record<string, FileAction[]>)
},
openedMenu: {
@@ -238,7 +238,7 @@ export default defineComponent({
},
mountType() {
- return this.source._attributes['mount-type']
+ return this.source.attributes['mount-type']
},
},