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 () => {