summaryrefslogtreecommitdiffstats
path: root/apps/files/src/components/FileEntry/FileEntryActions.vue
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-05-31 14:19:12 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-06-08 15:09:18 +0000
commit5b1969b0f5ef9edc9a78cea51326863497343fa9 (patch)
treed8835fec5d6cfa01a6fc0ec7626507163c36bfc2 /apps/files/src/components/FileEntry/FileEntryActions.vue
parent2770a56bb9f18aabc16dd790c350582639c507bf (diff)
downloadnextcloud-server-5b1969b0f5ef9edc9a78cea51326863497343fa9.tar.gz
nextcloud-server-5b1969b0f5ef9edc9a78cea51326863497343fa9.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/FileEntryActions.vue')
-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 abe71b7271b..27dba632d4b 100644
--- a/apps/files/src/components/FileEntry/FileEntryActions.vue
+++ b/apps/files/src/components/FileEntry/FileEntryActions.vue
@@ -229,12 +229,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: {
@@ -256,7 +256,7 @@ export default defineComponent({
},
mountType() {
- return this.source._attributes['mount-type']
+ return this.source.attributes['mount-type']
},
},