From 13a4fa09384fe1e3ed9a15133c2f24a068d1b30c Mon Sep 17 00:00:00 2001 From: Joscha Date: Tue, 2 Jan 2024 12:53:59 +0100 Subject: [PATCH] Support domain in room deletion popup --- cove/src/ui/rooms.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cove/src/ui/rooms.rs b/cove/src/ui/rooms.rs index 23537eb..fe7a6f3 100644 --- a/cove/src/ui/rooms.rs +++ b/cove/src/ui/rooms.rs @@ -254,7 +254,7 @@ impl Rooms { Self::rooms_widget(self.config, &mut self.list, self.order, &self.euph_rooms) .await // TODO Respect domain - .below(Self::delete_room_widget(&id.name, editor)) + .below(Self::delete_room_widget(id, editor)) .desync() .boxed_async() } @@ -276,15 +276,17 @@ impl Rooms { } fn delete_room_widget<'a>( - name: &str, + id: &RoomIdentifier, editor: &'a mut EditorState, ) -> impl Widget + 'a { let warn_style = Style::new().bold().red(); let room_style = Style::new().bold().blue(); let text = Styled::new_plain("Are you sure you want to delete ") .then("&", room_style) - .then(name, room_style) - .then_plain("?\n\n") + .then(&id.name, room_style) + .then_plain(" on the ") + .then(&id.domain, Style::new().grey()) + .then_plain(" server?\n\n") .then_plain("This will delete the entire room history from your vault. ") .then_plain("To shrink your vault afterwards, run ") .then("cove gc", Style::new().italic().grey())