chore(frontend): fix type errors
This commit is contained in:
parent
89ed8be8ff
commit
288f0abeac
|
@ -56,10 +56,12 @@ const emit = defineEmits<{
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
function getScreenY(event: TouchEvent | MouseEvent | PointerEvent): number {
|
function getScreenY(event: TouchEvent | MouseEvent | PointerEvent): number {
|
||||||
if (event.touches && event.touches[0] && event.touches[0].screenY != null) {
|
if (('touches' in event) && event.touches[0] && event.touches[0].screenY != null) {
|
||||||
return event.touches[0].screenY;
|
return event.touches[0].screenY;
|
||||||
} else {
|
} else if ('screenY' in event) {
|
||||||
return event.screenY;
|
return event.screenY;
|
||||||
|
} else {
|
||||||
|
return 0; // TSを黙らせるため
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ const elRef = useTemplateRef('elRef');
|
||||||
|
|
||||||
if (props.withTooltip) {
|
if (props.withTooltip) {
|
||||||
useTooltip(elRef, (showing) => {
|
useTooltip(elRef, (showing) => {
|
||||||
|
if (elRef.value == null) return;
|
||||||
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkReactionTooltip.vue')), {
|
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkReactionTooltip.vue')), {
|
||||||
showing,
|
showing,
|
||||||
reaction: props.reaction.replace(/^:(\w+):$/, ':$1@.:'),
|
reaction: props.reaction.replace(/^:(\w+):$/, ':$1@.:'),
|
||||||
|
|
|
@ -48,7 +48,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<FormSection v-if="instance.repositoryUrl !== 'https://github.com/misskey-dev/misskey'">
|
<FormSection v-if="instance.repositoryUrl !== 'https://github.com/misskey-dev/misskey'">
|
||||||
<div class="_gaps_s">
|
<div class="_gaps_s">
|
||||||
<MkInfo>
|
<MkInfo>
|
||||||
{{ i18n.tsx._aboutMisskey.thisIsModifiedVersion({ name: instance.name }) }}
|
{{ i18n.tsx._aboutMisskey.thisIsModifiedVersion({ name: instance.name ?? host }) }}
|
||||||
</MkInfo>
|
</MkInfo>
|
||||||
<FormLink v-if="instance.repositoryUrl" :to="instance.repositoryUrl" external>
|
<FormLink v-if="instance.repositoryUrl" :to="instance.repositoryUrl" external>
|
||||||
<template #icon><i class="ti ti-code"></i></template>
|
<template #icon><i class="ti ti-code"></i></template>
|
||||||
|
@ -134,7 +134,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { nextTick, onBeforeUnmount, ref, useTemplateRef, computed } from 'vue';
|
import { nextTick, onBeforeUnmount, ref, useTemplateRef, computed } from 'vue';
|
||||||
import { version } from '@@/js/config.js';
|
import { host, version } from '@@/js/config.js';
|
||||||
import FormLink from '@/components/form/link.vue';
|
import FormLink from '@/components/form/link.vue';
|
||||||
import FormSection from '@/components/form/section.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
|
@ -414,6 +414,7 @@ const easterEggEngine = ref<{ stop: () => void } | null>(null);
|
||||||
const containerEl = useTemplateRef('containerEl');
|
const containerEl = useTemplateRef('containerEl');
|
||||||
|
|
||||||
function iconLoaded() {
|
function iconLoaded() {
|
||||||
|
if (containerEl.value == null) return;
|
||||||
const emojis = prefer.s.emojiPalettes[0].emojis;
|
const emojis = prefer.s.emojiPalettes[0].emojis;
|
||||||
const containerWidth = containerEl.value.offsetWidth;
|
const containerWidth = containerEl.value.offsetWidth;
|
||||||
for (let i = 0; i < 32; i++) {
|
for (let i = 0; i < 32; i++) {
|
||||||
|
@ -431,6 +432,7 @@ function iconLoaded() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function gravity() {
|
function gravity() {
|
||||||
|
if (containerEl.value == null) return;
|
||||||
if (!easterEggReady) return;
|
if (!easterEggReady) return;
|
||||||
easterEggReady = false;
|
easterEggReady = false;
|
||||||
easterEggEngine.value = physics(containerEl.value);
|
easterEggEngine.value = physics(containerEl.value);
|
||||||
|
|
Loading…
Reference in New Issue