Fix delete room

This commit is contained in:
N-Pex 2025-06-19 12:12:40 +02:00
parent 422e856cd9
commit 10b4c8ac35
2 changed files with 30 additions and 41 deletions

View file

@ -7,16 +7,14 @@
scroll-strategy="none"
>
<div v-if="timeout == -1" class="dialog-content text-center">
<template>
<v-icon size="28">$vuetify.icons.trash_black</v-icon>
<h2 class="dialog-title">{{ $t("purge_room.title") }}</h2>
<div class="dialog-text">
{{ $t("purge_room.info") }}
</div>
<div class="dialog-text">
{{ status }}
</div>
</template>
<v-icon size="28">$vuetify.icons.trash_black</v-icon>
<h2 class="dialog-title">{{ $t("purge_room.title") }}</h2>
<div class="dialog-text">
{{ $t("purge_room.info") }}
</div>
<div class="dialog-text">
{{ status }}
</div>
<v-container fluid>
<v-row cols="12">
<v-col cols="6">
@ -48,18 +46,15 @@
<!-- Timer -->
<div v-if="timeout >= 0 && !isPurging" class="dialog-content text-center">
<template>
<v-icon size="20"
class="d-inline-block me-2">$vuetify.icons.timer</v-icon>
{{ $t("purge_room.n_seconds", { seconds: timeout }) }}
<h2 class="dialog-title mb-0">{{ $t("purge_room.self_destruct") }}</h2>
<div class="dialog-text text-center mb-5">
{{ $t("purge_room.notified") }}
</div>
<div class="dialog-text">
{{ status }}
</div>
</template>
<v-icon size="20" class="d-inline-block me-2">$vuetify.icons.timer</v-icon>
{{ $t("purge_room.n_seconds", { seconds: timeout }) }}
<h2 class="dialog-title mb-0">{{ $t("purge_room.self_destruct") }}</h2>
<div class="dialog-text text-center mb-5">
{{ $t("purge_room.notified") }}
</div>
<div class="dialog-text">
{{ status }}
</div>
<v-container fluid>
<v-row cols="12">
<v-col cols="6">
@ -107,7 +102,7 @@ export default {
};
},
methods: {
onOpenDialog() {
onOpenDialog() {
// Showing, reset
this.status = null;
},
@ -119,21 +114,17 @@ export default {
this.timeout = -1;
// Cancel the state event for deletion
this.$matrix.matrixClient.sendStateEvent(
this.room.roomId,
STATE_EVENT_ROOM_DELETION_NOTICE,
{ status: "cancel" }
);
this.$matrix.matrixClient.sendStateEvent(this.room.roomId, STATE_EVENT_ROOM_DELETION_NOTICE, {
status: "cancel",
});
this.showDialog = false;
},
onPurgeRoom() {
// Send custom state event!
this.$matrix.matrixClient.sendStateEvent(
this.room.roomId,
STATE_EVENT_ROOM_DELETION_NOTICE,
{ status: "delete" }
);
this.$matrix.matrixClient.sendStateEvent(this.room.roomId, STATE_EVENT_ROOM_DELETION_NOTICE, {
status: "delete",
});
this.timeout = 7;
this.timeoutTimer = setInterval(() => {
@ -144,7 +135,7 @@ export default {
}, 1000);
},
onDoPurgeRoom() {
this.timeout = 0
this.timeout = 0;
clearInterval(this.timeoutTimer);
this.timeoutTimer = null;
this.isPurging = true;