aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/components/FileEntry.vue
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-02-04 21:13:06 +0100
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-04-06 14:49:29 +0200
commit03c32774b060f48a900be5f9f943de84c298cca5 (patch)
tree74bea842d02548e9e02454e778e2b32c5a81a78b /apps/files/src/components/FileEntry.vue
parent29a7f7f6efd2a9791fdcfb9f9f7e862bafd8da82 (diff)
downloadnextcloud-server-03c32774b060f48a900be5f9f943de84c298cca5.tar.gz
nextcloud-server-03c32774b060f48a900be5f9f943de84c298cca5.zip
feat(files): switch to pinia
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/src/components/FileEntry.vue')
-rw-r--r--apps/files/src/components/FileEntry.vue24
1 files changed, 18 insertions, 6 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue
index de340917b69..204976061df 100644
--- a/apps/files/src/components/FileEntry.vue
+++ b/apps/files/src/components/FileEntry.vue
@@ -47,12 +47,15 @@ import { Folder, File } from '@nextcloud/files'
import { Fragment } from 'vue-fragment'
import { join } from 'path'
import { translate } from '@nextcloud/l10n'
-import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import FolderIcon from 'vue-material-design-icons/Folder.vue'
+import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
+import Vue from 'vue'
import logger from '../logger'
+import { useSelectionStore } from '../store/selection'
+import { useFilesStore } from '../store/files'
-export default {
+export default Vue.extend({
name: 'FileEntry',
components: {
@@ -72,6 +75,15 @@ export default {
},
},
+ setup() {
+ const filesStore = useFilesStore()
+ const selectionStore = useSelectionStore()
+ return {
+ filesStore,
+ selectionStore,
+ }
+ },
+
computed: {
dir() {
// Remove any trailing slash but leave root slash
@@ -104,11 +116,11 @@ export default {
selectedFiles: {
get() {
- return this.$store.state.selection.selected
+ return this.selectionStore.selected
},
set(selection) {
logger.debug('Added node to selection', { selection })
- this.$store.dispatch('selection/set', selection)
+ this.selectionStore.set(selection)
},
},
},
@@ -121,12 +133,12 @@ export default {
* @return {Folder|File}
*/
getNode(fileId) {
- return this.$store.getters['files/getNode'](fileId)
+ return this.filesStore.getNode(fileId)
},
t: translate,
},
-}
+})
</script>
<style scoped lang="scss">