import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
import ArrowLeftIcon from 'vue-material-design-icons/ArrowLeft.vue'
-
-import { useNavigation } from '../../composables/useNavigation'
import CustomElementRender from '../CustomElementRender.vue'
+import { useNavigation } from '../../composables/useNavigation'
import logger from '../../logger.js'
// The registered actions list
computed: {
currentDir() {
// Remove any trailing slash but leave root slash
- return (this.$route?.query?.dir?.toString() || '/').replace(/^(.+)\/$/, '$1')
+ return (this.$route.query?.dir?.toString() || '/').replace(/^(.+)\/$/, '$1')
},
currentFileId() {
return this.$route.params?.fileid || this.$route.query?.fileid || null
},
fileid() {
- return this.source?.fileid
+ return this.source.fileid ?? 0
},
uniqueId() {
return hashCode(this.source.source)
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
+/**
+ * Simple non-secure hashing function similar to Java's `hashCode`
+ * @param str The string to hash
+ * @return {number} a non secure hash of the string
+ */
export const hashCode = function(str: string): number {
let hash = 0
for (let i = 0; i < str.length; i++) {