Support domain in room deletion popup

This commit is contained in:
Joscha 2024-01-02 12:53:59 +01:00
parent 2a10a7a39f
commit 13a4fa0938

View file

@ -254,7 +254,7 @@ impl Rooms {
Self::rooms_widget(self.config, &mut self.list, self.order, &self.euph_rooms) Self::rooms_widget(self.config, &mut self.list, self.order, &self.euph_rooms)
.await .await
// TODO Respect domain // TODO Respect domain
.below(Self::delete_room_widget(&id.name, editor)) .below(Self::delete_room_widget(id, editor))
.desync() .desync()
.boxed_async() .boxed_async()
} }
@ -276,15 +276,17 @@ impl Rooms {
} }
fn delete_room_widget<'a>( fn delete_room_widget<'a>(
name: &str, id: &RoomIdentifier,
editor: &'a mut EditorState, editor: &'a mut EditorState,
) -> impl Widget<UiError> + 'a { ) -> impl Widget<UiError> + 'a {
let warn_style = Style::new().bold().red(); let warn_style = Style::new().bold().red();
let room_style = Style::new().bold().blue(); let room_style = Style::new().bold().blue();
let text = Styled::new_plain("Are you sure you want to delete ") let text = Styled::new_plain("Are you sure you want to delete ")
.then("&", room_style) .then("&", room_style)
.then(name, room_style) .then(&id.name, room_style)
.then_plain("?\n\n") .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("This will delete the entire room history from your vault. ")
.then_plain("To shrink your vault afterwards, run ") .then_plain("To shrink your vault afterwards, run ")
.then("cove gc", Style::new().italic().grey()) .then("cove gc", Style::new().italic().grey())