diff --git a/apps/mtxchat/locales/i18n.json b/apps/mtxchat/locales/i18n.json index b97d4188d..e7d1166c2 100644 --- a/apps/mtxchat/locales/i18n.json +++ b/apps/mtxchat/locales/i18n.json @@ -225,6 +225,10 @@ "ja": "WiFi not connected. Entering read-only mode *EN*", "zh": "WiFi not connected. Entering read-only mode *EN*" }, + "mtxchat.listen.patience": { + "en": "It takes a while to get new events from the [matrix] server.\nPlease be patient :-)", + "en-tts": "It takes a while to get new events from the [matrix] server.\nPlease be patient." + }, "mtxchat.close.item": { "en": "Close menu", "en-tts": "Close menu" diff --git a/apps/mtxchat/src/lib.rs b/apps/mtxchat/src/lib.rs index 33c448047..808fbff72 100644 --- a/apps/mtxchat/src/lib.rs +++ b/apps/mtxchat/src/lib.rs @@ -78,6 +78,7 @@ pub struct MtxChat<'a> { since: String, listening: bool, modals: Modals, + new_room: bool, } impl<'a> MtxChat<'a> { pub fn new(chat: &Chat) -> MtxChat { @@ -103,6 +104,7 @@ impl<'a> MtxChat<'a> { since: EMPTY.to_string(), listening: false, modals: modals, + new_room: false, } } @@ -243,6 +245,12 @@ impl<'a> MtxChat<'a> { if let Some(room) = self.get_room_id() { self.dialogue_set(Some(room.as_str())); self.listen(); + if self.new_room { + self.new_room = false; + self.modals + .show_notification(t!("mtxchat.listen.patience", locales::LANG), None) + .expect("notification failed"); + } return true; } else { self.modals @@ -403,10 +411,13 @@ impl<'a> MtxChat<'a> { let builder = match self.get(ROOM_NAME_KEY) { // TODO add TextValidationFn Ok(Some(room)) => builder.field_placeholder_persist(Some(room), None), - _ => builder.field( - Some(t!("mtxchat.room.name", locales::LANG).to_string()), - None, - ), + _ => { + self.new_room = true; + builder.field( + Some(t!("mtxchat.room.name", locales::LANG).to_string()), + None, + ) + } }; let builder = match self.get(ROOM_DOMAIN_KEY) { // TODO add TextValidationFn