From 2370b55a27168034e54dba6e87e665dc3db6dacb Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Tue, 25 Mar 2025 09:30:14 +0900 Subject: [PATCH] =?UTF-8?q?enhance(frontend):=20=E3=83=81=E3=83=A3?= =?UTF-8?q?=E3=83=83=E3=83=88=E3=83=AB=E3=83=BC=E3=83=A0=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/index.d.ts | 4 ++++ locales/ja-JP.yml | 1 + packages/frontend/src/pages/chat/room.info.vue | 17 +++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/locales/index.d.ts b/locales/index.d.ts index 560335bf35..737a2d77d6 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -5452,6 +5452,10 @@ export interface Locale extends ILocale { * このルームをミュート */ "muteThisRoom": string; + /** + * ルームを削除 + */ + "deleteRoom": string; /** * このユーザーとのチャットを開始できません */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 9b4d74fbfb..93dc352799 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1360,6 +1360,7 @@ _chat: searchMessages: "メッセージを検索" home: "ホーム" muteThisRoom: "このルームをミュート" + deleteRoom: "ルームを削除" cannotChatWithTheUser: "このユーザーとのチャットを開始できません" cannotChatWithTheUser_description: "チャットが使えない状態になっているか、相手がチャットを開放していません。" chatWithThisUser: "チャットする" diff --git a/packages/frontend/src/pages/chat/room.info.vue b/packages/frontend/src/pages/chat/room.info.vue index 7d38d07b3a..f4f5e217dd 100644 --- a/packages/frontend/src/pages/chat/room.info.vue +++ b/packages/frontend/src/pages/chat/room.info.vue @@ -17,6 +17,8 @@ SPDX-License-Identifier: AGPL-3.0-only
+ {{ i18n.ts._chat.deleteRoom }} + @@ -34,7 +36,9 @@ import { ensureSignin } from '@/i.js'; import MkInput from '@/components/MkInput.vue'; import MkTextarea from '@/components/MkTextarea.vue'; import MkSwitch from '@/components/MkSwitch.vue'; +import { useRouter } from '@/router.js'; +const router = useRouter(); const $i = ensureSignin(); const props = defineProps<{ @@ -56,6 +60,19 @@ function save() { }); } +async function del() { + const { canceled } = await os.confirm({ + type: 'warning', + text: i18n.ts.areYouSure, + }); + if (canceled) return; + + misskeyApi('chat/rooms/delete', { + roomId: props.room.id, + }); + router.push('/chat'); +} + const isMuted = ref(props.room.isMuted); watch(isMuted, async () => {