diff --git a/frontend/src/components/Header.vue b/frontend/src/components/Header.vue index ff8593ba..6d9a1270 100644 --- a/frontend/src/components/Header.vue +++ b/frontend/src/components/Header.vue @@ -37,7 +37,7 @@ - + diff --git a/frontend/src/components/files/ListingItem.vue b/frontend/src/components/files/ListingItem.vue index 2419e7c2..45297ec2 100644 --- a/frontend/src/components/files/ListingItem.vue +++ b/frontend/src/components/files/ListingItem.vue @@ -13,7 +13,7 @@ :aria-label="name" :aria-selected="isSelected">
- + {{ icon }}
@@ -47,8 +47,12 @@ export default { }, props: ['name', 'isDir', 'url', 'type', 'size', 'modified', 'index'], computed: { - ...mapState(['user', 'selected', 'req', 'user', 'jwt']), + ...mapState(['user', 'selected', 'req', 'jwt']), ...mapGetters(['selectedCount', 'isSharing']), + singleClick () { + if (this.isSharing) return false + return this.user.singleClick + }, isSelected () { return (this.selected.indexOf(this.index) !== -1) }, @@ -60,7 +64,7 @@ export default { return 'insert_drive_file' }, isDraggable () { - return this.user.perm.rename + return !this.isSharing && this.user.perm.rename }, canDrop () { if (!this.isDir || this.isSharing) return false @@ -171,11 +175,11 @@ export default { action(overwrite, rename) }, itemClick: function(event) { - if (this.user.singleClick && !this.$store.state.multiple) this.open() + if (this.singleClick && !this.$store.state.multiple) this.open() else this.click(event) }, click: function (event) { - if (!this.user.singleClick && this.selectedCount !== 0) event.preventDefault() + if (!this.singleClick && this.selectedCount !== 0) event.preventDefault() if (this.$store.state.selected.indexOf(this.index) !== -1) { this.removeSelected(this.index) return @@ -202,11 +206,11 @@ export default { return } - if (!this.user.singleClick && !event.ctrlKey && !this.$store.state.multiple) this.resetSelected() + if (!this.singleClick && !event.ctrlKey && !this.$store.state.multiple) this.resetSelected() this.addSelected(this.index) }, dblclick: function () { - if (!this.user.singleClick) this.open() + if (!this.singleClick) this.open() }, touchstart () { setTimeout(() => { diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index e5b22510..199d09ca 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -7,18 +7,7 @@ import upload from './modules/upload' Vue.use(Vuex) const state = { - user: { - perm: { - admin: false, - create: false, - delete: false, - download: false, - execute: false, - modify: false, - rename: false, - share: false - } - }, + user: null, req: {}, oldReq: {}, clipboard: {