aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/components/FileEntry.vue
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-04-04 18:19:17 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-04-06 15:31:37 +0200
commit13611824395d1a187b28f153e933b5ff56a4e566 (patch)
tree0462ac61ff40e3b976b536bdd9bbdbe266c2f86b /apps/files/src/components/FileEntry.vue
parent904348b8c75aef856984e7c24a9b666ad8d257fd (diff)
downloadnextcloud-server-13611824395d1a187b28f153e933b5ff56a4e566.tar.gz
nextcloud-server-13611824395d1a187b28f153e933b5ff56a4e566.zip
chore(eslint): clean and fix
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.vue36
1 files changed, 15 insertions, 21 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue
index 33e8438156b..260294e1a36 100644
--- a/apps/files/src/components/FileEntry.vue
+++ b/apps/files/src/components/FileEntry.vue
@@ -43,9 +43,9 @@
class="files-list__row-icon-preview"
:style="{ backgroundImage }" />
- <span v-else-if="mimeUrl"
+ <span v-else-if="mimeIconUrl"
class="files-list__row-icon-preview files-list__row-icon-preview--mime"
- :style="{ backgroundImage: mimeUrl }" />
+ :style="{ backgroundImage: mimeIconUrl }" />
<FileIcon v-else />
</span>
@@ -100,7 +100,7 @@
<script lang='ts'>
import { debounce } from 'debounce'
-import { Folder, File, formatFileSize } from '@nextcloud/files'
+import { formatFileSize } from '@nextcloud/files'
import { Fragment } from 'vue-fragment'
import { join } from 'path'
import { showError } from '@nextcloud/dialogs'
@@ -114,12 +114,11 @@ import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadi
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
import Vue from 'vue'
-import { isCachedPreview } from '../services/PreviewService'
-import { getFileActions } from '../services/FileAction'
-import { useFilesStore } from '../store/files'
-import { UserConfig } from '../types'
-import { useSelectionStore } from '../store/selection'
-import { useUserConfigStore } from '../store/userconfig'
+import { isCachedPreview } from '../services/PreviewService.ts'
+import { getFileActions } from '../services/FileAction.ts'
+import { useFilesStore } from '../store/files.ts'
+import { useSelectionStore } from '../store/selection.ts'
+import { useUserConfigStore } from '../store/userconfig.ts'
import CustomElementRender from './CustomElementRender.vue'
import CustomSvgIconRender from './CustomSvgIconRender.vue'
import logger from '../logger.js'
@@ -181,12 +180,10 @@ export default Vue.extend({
},
computed: {
- /** @return {UserConfig} */
userConfig() {
return this.userConfigStore.userConfig
},
- /** @return {Navigation} */
currentView() {
return this.$navigation.active
},
@@ -272,11 +269,11 @@ export default Vue.extend({
}
},
- mimeUrl() {
+ mimeIconUrl() {
const mimeType = this.source.mime || 'application/octet-stream'
- const mimeUrl = window.OC?.MimeType?.getIconUrl?.(mimeType)
- if (mimeUrl) {
- return `url(${mimeUrl})`
+ const mimeIconUrl = window.OC?.MimeType?.getIconUrl?.(mimeType)
+ if (mimeIconUrl) {
+ return `url(${mimeIconUrl})`
}
return ''
},
@@ -309,7 +306,8 @@ export default Vue.extend({
this.resetState()
// When the row is not active anymore
- // remove the tabindex from the row
+ // remove the display from the row to prevent
+ // keyboard interaction with it.
this.$el.parentNode.style.display = 'none'
return
}
@@ -376,9 +374,6 @@ export default Vue.extend({
this.clearImg()
}
- // Ensure max 5 previews are being fetched at the same time
- const controller = new AbortController()
-
// Store the promise to be able to cancel it
this.previewPromise = new CancelablePromise((resolve, reject, onCancel) => {
const img = new Image()
@@ -400,7 +395,6 @@ export default Vue.extend({
img.onerror = null
img.onload = null
img.src = ''
- controller.abort()
})
})
},
@@ -413,7 +407,7 @@ export default Vue.extend({
this.clearImg()
// Close menu
- this.$refs.actionsMenu.closeMenu()
+ this.$refs?.actionsMenu?.closeMenu?.()
},
clearImg() {