Merge branch '558-add-delete-now-button-to-self-destruct-countdown' into 'dev'

ux: delete now and increase self destruct time

See merge request keanuapp/keanuapp-weblite!266
This commit is contained in:
N Pex 2023-11-13 15:02:01 +00:00
commit dd22ae45b7
2 changed files with 14 additions and 7 deletions

View file

@ -36,6 +36,7 @@
"logout": "Logout",
"new_room": "New Room",
"undo": "Undo",
"delete_now": "Delete now",
"join": "Join",
"ignore": "Ignore",
"loading": "Loading {appName}",
@ -270,7 +271,7 @@
"info": "All members and messages will be removed. This action cannot be undone.",
"button": "Delete",
"n_seconds": "{seconds} seconds",
"self_destruct": "Room will self destruct in seconds.",
"self_destruct": "Your room will self destruct in seconds.",
"deleting": "Deleting room:",
"notified": "We've notified members.",
"room_deletion_notice": "Time to say goodbye! This room has been deleted by {user}. It will self destruct in seconds."

View file

@ -55,8 +55,8 @@
class="d-inline-block me-2"
src="@/assets/icons/timer.svg"
/>{{ $t("purge_room.n_seconds", { seconds: timeout }) }}
<h2 class="dialog-title">{{ $t("purge_room.self_destruct") }}</h2>
<div class="dialog-text">
<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">
@ -65,7 +65,7 @@
</template>
<v-container fluid>
<v-row cols="12">
<v-col cols="12">
<v-col cols="6">
<v-btn
id="btn-purge-room-undo"
depressed
@ -77,6 +77,11 @@
>{{ $t("menu.undo") }}</v-btn
>
</v-col>
<v-col cols="6">
<v-btn depressed block class="outlined-button" @click="onDoPurgeRoom">
{{ $t("menu.delete_now") }}
</v-btn>
</v-col>
</v-row>
</v-container>
</div>
@ -156,17 +161,18 @@ export default {
{ status: "delete" }
);
this.timeout = 5;
this.timeout = 7;
this.timeoutTimer = setInterval(() => {
this.timeout = this.timeout - 1;
if (this.timeout == 0) {
clearInterval(this.timeoutTimer);
this.timeoutTimer = null;
this.onDoPurgeRoom();
}
}, 1000);
},
onDoPurgeRoom() {
this.timeout = 0
clearInterval(this.timeoutTimer);
this.timeoutTimer = null;
this.isPurging = true;
this.$matrix
.purgeRoom(this.room.roomId, this.onPurgeStatus)