Skip to content

Commit afa5923

Browse files
skjnldsvnextcloud-command
authored andcommitted
Prevent editing if mobile
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
1 parent 04c844d commit afa5923

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

js/viewer-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/viewer-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/views/Viewer.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ import { subscribe, unsubscribe } from '@nextcloud/event-bus'
133133
134134
import ActionButton from '@nextcloud/vue/dist/Components/ActionButton.js'
135135
import ActionLink from '@nextcloud/vue/dist/Components/ActionLink.js'
136-
import isFullscreen from '@nextcloud/vue/dist/Mixins/isFullscreen.js'
137136
import Modal from '@nextcloud/vue/dist/Components/Modal.js'
137+
import isFullscreen from '@nextcloud/vue/dist/Mixins/isFullscreen.js'
138+
import isMobile from '@nextcloud/vue/dist/Mixins/isMobile'
138139
139140
import { extractFilePaths, sortCompare } from '../utils/fileUtils.js'
140141
import { getRootPath } from '../utils/davUtils.js'
@@ -163,7 +164,7 @@ export default {
163164
Modal,
164165
},
165166
166-
mixins: [isFullscreen],
167+
mixins: [isFullscreen, isMobile],
167168
168169
data() {
169170
return {
@@ -268,7 +269,8 @@ export default {
268269
* @return {boolean}
269270
*/
270271
canEdit() {
271-
return canDownload()
272+
return !this.isMobile
273+
&& canDownload()
272274
&& this.currentFile?.permissions?.includes('W')
273275
&& ['image/jpeg', 'image/png', 'image/webp'].includes(this.currentFile?.mime)
274276
},

0 commit comments

Comments
 (0)