enhance(frontend): チャットルームを削除できるように
This commit is contained in:
parent
5d3e8253c4
commit
2370b55a27
3 changed files with 22 additions and 0 deletions
|
|
@ -17,6 +17,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
|
||||
<hr>
|
||||
|
||||
<MkButton v-if="isOwner" danger @click="del">{{ i18n.ts._chat.deleteRoom }}</MkButton>
|
||||
|
||||
<MkSwitch v-if="!isOwner" v-model="isMuted">
|
||||
<template #label>{{ i18n.ts._chat.muteThisRoom }}</template>
|
||||
</MkSwitch>
|
||||
|
|
@ -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 () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue