Fix ts errors

This commit is contained in:
Kloon ImKloon 2023-10-07 17:06:57 +02:00
parent 70707fbd0e
commit df9d199044
No known key found for this signature in database
GPG Key ID: CCF1C86A995C5B6A
4 changed files with 15 additions and 15 deletions

View File

@ -29,7 +29,7 @@ const route = useRoute();
const props = defineProps<{
base: string;
noLink: boolean;
noLink?: boolean;
}>();
const items = computed(() => {
@ -72,7 +72,7 @@ const items = computed(() => {
});
const element = computed(() => {
if (props.noLink !== undefined) {
if (props.noLink) {
return "span";
}

View File

@ -15,7 +15,7 @@
>
<div>
<img
v-if="readOnly == undefined && type === 'image' && isThumbsEnabled"
v-if="!readOnly && type === 'image' && isThumbsEnabled"
v-lazy="thumbnailUrl"
/>
<i v-else class="material-icons"></i>
@ -60,8 +60,8 @@ const props = defineProps<{
size: number;
modified: string;
index: number;
readOnly: boolean;
path: string;
readOnly?: boolean;
path?: string;
}>();
const authStore = useAuthStore();
@ -69,17 +69,17 @@ const fileStore = useFileStore();
const layoutStore = useLayoutStore();
const singleClick = computed(
() => props.readOnly == undefined && authStore.user?.singleClick
() => !props.readOnly && authStore.user?.singleClick
);
const isSelected = computed(
() => fileStore.selected.indexOf(props.index) !== -1
);
const isDraggable = computed(
() => props.readOnly == undefined && authStore.user?.perm.rename
() => !props.readOnly && authStore.user?.perm.rename
);
const canDrop = computed(() => {
if (!props.isDir || props.readOnly !== undefined) return false;
if (!props.isDir || props.readOnly) return false;
for (let i of fileStore.selected) {
if (fileStore.req?.items[i].url === props.url) {
@ -111,7 +111,7 @@ const humanSize = () => {
};
const humanTime = () => {
if (props.readOnly == undefined && authStore.user?.dateFormat) {
if (!props.readOnly && authStore.user?.dateFormat) {
return dayjs(props.modified).format("L LT");
}
return dayjs(props.modified).fromNow();

View File

@ -1,8 +1,8 @@
<template>
<header>
<img v-if="showLogo !== undefined" :src="logoURL" />
<img v-if="showLogo" :src="logoURL" />
<Action
v-if="showMenu !== undefined"
v-if="showMenu"
class="menu-button"
icon="menu"
:label="t('buttons.toggleSidebar')"
@ -41,8 +41,8 @@ import { computed, useSlots } from "vue";
import { useI18n } from "vue-i18n";
defineProps<{
showLogo: boolean;
showMenu: boolean;
showLogo?: boolean;
showMenu?: boolean;
}>();
const layoutStore = useLayoutStore();

View File

@ -18,13 +18,13 @@ interface Resource extends ResourceBase {
sorting: Sorting;
hash?: string;
token?: string;
index?: number;
index: number;
subtitles?: string[];
content?: string;
}
interface ResourceItem extends ResourceBase {
index?: number;
index: number;
subtitles?: string[];
}