Skip to content

Commit

Permalink
Merge pull request #1334 from nextcloud/feat/mobile-editor-prevent
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv committed Aug 17, 2022
2 parents 04c844d + afa5923 commit e4bce96
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ import { subscribe, unsubscribe } from '@nextcloud/event-bus'
import ActionButton from '@nextcloud/vue/dist/Components/ActionButton.js'
import ActionLink from '@nextcloud/vue/dist/Components/ActionLink.js'
import isFullscreen from '@nextcloud/vue/dist/Mixins/isFullscreen.js'
import Modal from '@nextcloud/vue/dist/Components/Modal.js'
import isFullscreen from '@nextcloud/vue/dist/Mixins/isFullscreen.js'
import isMobile from '@nextcloud/vue/dist/Mixins/isMobile'
import { extractFilePaths, sortCompare } from '../utils/fileUtils.js'
import { getRootPath } from '../utils/davUtils.js'
Expand Down Expand Up @@ -163,7 +164,7 @@ export default {
Modal,
},
mixins: [isFullscreen],
mixins: [isFullscreen, isMobile],
data() {
return {
Expand Down Expand Up @@ -268,7 +269,8 @@ export default {
* @return {boolean}
*/
canEdit() {
return canDownload()
return !this.isMobile
&& canDownload()
&& this.currentFile?.permissions?.includes('W')
&& ['image/jpeg', 'image/png', 'image/webp'].includes(this.currentFile?.mime)
},
Expand Down

0 comments on commit e4bce96

Please sign in to comment.