mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-04 14:16:03 +02:00
refactor(frontend): フロントエンドの型エラー解消 (#16694)
This commit is contained in:
@@ -20,7 +20,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<script lang="ts" setup>
|
||||
import { computed, inject, onMounted, useTemplateRef, watch } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { getUnicodeEmoji } from '@@/js/emojilist.js';
|
||||
import { getUnicodeEmojiOrNull } from '@@/js/emojilist.js';
|
||||
import MkCustomEmojiDetailedDialog from './MkCustomEmojiDetailedDialog.vue';
|
||||
import type { MenuItem } from '@/types/menu';
|
||||
import XDetails from '@/components/MkReactionsViewer.details.vue';
|
||||
@@ -60,11 +60,11 @@ const buttonEl = useTemplateRef('buttonEl');
|
||||
const emojiName = computed(() => props.reaction.replace(/:/g, '').replace(/@\./, ''));
|
||||
|
||||
const canToggle = computed(() => {
|
||||
const emoji = customEmojisMap.get(emojiName.value) ?? getUnicodeEmoji(props.reaction);
|
||||
const emoji = customEmojisMap.get(emojiName.value) ?? getUnicodeEmojiOrNull(props.reaction);
|
||||
|
||||
// TODO
|
||||
//return !props.reaction.match(/@\w/) && $i && emoji && checkReactionPermissions($i, props.note, emoji);
|
||||
return !props.reaction.match(/@\w/) && $i && emoji;
|
||||
return props.reaction.match(/@\w/) == null && $i != null && emoji != null;
|
||||
});
|
||||
const canGetInfo = computed(() => !props.reaction.match(/@\w/) && props.reaction.includes(':'));
|
||||
const isLocalCustomEmoji = props.reaction[0] === ':' && props.reaction.includes('@.');
|
||||
|
||||
@@ -64,6 +64,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import type { Awaitable } from '@/types/misc.js';
|
||||
|
||||
export type SuperMenuDef = {
|
||||
title?: string;
|
||||
items: ({
|
||||
@@ -80,7 +82,7 @@ export type SuperMenuDef = {
|
||||
text: string;
|
||||
danger?: boolean;
|
||||
active?: boolean;
|
||||
action: (ev: MouseEvent) => void | Promise<void>;
|
||||
action: (ev: MouseEvent) => Awaitable<void>;
|
||||
} | {
|
||||
type?: 'link';
|
||||
to: string;
|
||||
|
||||
Reference in New Issue
Block a user