From 6f964f56cc700c44775c065165332d18c3666ff6 Mon Sep 17 00:00:00 2001 From: mattyatea Date: Thu, 19 Oct 2023 22:51:25 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20unused=E3=81=AA=E3=82=84=E3=81=A4?= =?UTF-8?q?=E6=B6=88=E3=81=97=E3=81=9F=E3=82=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: mattyatea --- .../api/endpoints/admin/emoji/add-draft.ts | 3 +-- .../src/components/MkEmojiEditDialog.vue | 19 ------------------- packages/frontend/src/pages/about.emojis.vue | 2 +- packages/frontend/src/pages/emojis.emoji.vue | 1 - 4 files changed, 2 insertions(+), 23 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/add-draft.ts b/packages/backend/src/server/api/endpoints/admin/emoji/add-draft.ts index 57de1e0ed8..5212d7285b 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/add-draft.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/add-draft.ts @@ -1,7 +1,6 @@ import { Inject, Injectable } from '@nestjs/common'; -import rndstr from 'rndstr'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { CustomEmojiService } from '@/core/CustomEmojiService.js'; import { ModerationLogService } from '@/core/ModerationLogService.js'; diff --git a/packages/frontend/src/components/MkEmojiEditDialog.vue b/packages/frontend/src/components/MkEmojiEditDialog.vue index 83c7fa4d22..65690042a5 100644 --- a/packages/frontend/src/components/MkEmojiEditDialog.vue +++ b/packages/frontend/src/components/MkEmojiEditDialog.vue @@ -7,7 +7,6 @@ SPDX-License-Identifier: AGPL-3.0-only @@ -116,7 +115,6 @@ let file = $ref(); let chooseFile: DriveFile|null = $ref(null); let draft = $ref(props.emoji ? props.emoji.draft : false); let isRequest = $ref(props.isRequest); -let url; watch($$(roleIdsThatCanBeUsedThisEmojiAsReaction), async () => { rolesThatCanBeUsedThisEmojiAsReaction = (await Promise.all(roleIdsThatCanBeUsedThisEmojiAsReaction.map((id) => os.api('admin/roles/show', { roleId: id }).catch(() => null)))).filter(x => x != null); @@ -131,16 +129,6 @@ const emit = defineEmits<{ (ev: 'closed'): void }>(); -function ok() { - if (isRequest) { - if (chooseFile !== null && name.match(/^[a-zA-Z0-9_]+$/)) { - add(); - } - } else { - update(); - } -} - async function add() { const ret = await os.api('admin/emoji/add-draft', { name: name, @@ -253,13 +241,6 @@ async function done() { } } -function chooseFileFrom(ev) { - selectFiles(ev.currentTarget ?? ev.target, i18n.ts.attachFile).then(files_ => { - chooseFile = files_[0]; - url = chooseFile.url; - }); -} - async function del() { const { canceled } = await os.confirm({ type: 'warning', diff --git a/packages/frontend/src/pages/about.emojis.vue b/packages/frontend/src/pages/about.emojis.vue index 61843c393a..f51cc1b640 100644 --- a/packages/frontend/src/pages/about.emojis.vue +++ b/packages/frontend/src/pages/about.emojis.vue @@ -45,7 +45,7 @@ SPDX-License-Identifier: AGPL-3.0-only