Skip to content

Commit 406d434

Browse files
authored
Merge pull request #205 from kevinaboos/more_login_status_updates
Add more details to status messages shown on the login screen.
2 parents a308213 + 8c1e738 commit 406d434

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

src/login/login_screen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ live_design! {
177177

178178
status_label = <Label> {
179179
width: 250, height: Fit
180-
padding: {left: 5, right: 5}
180+
padding: {left: 5, right: 5, top: 10, bottom: 10}
181181
draw_text: {
182182
color: (MESSAGE_TEXT_COLOR)
183183
text_style: <REGULAR_TEXT> {}

src/persistent_state.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ pub async fn restore_session(
106106
let FullSessionPersisted { client_session, user_session, sync_token } =
107107
serde_json::from_str(&serialized_session)?;
108108

109+
let status_str = format!(
110+
"Loaded session file for {user_id}. Trying to connect to homeserver ({})...",
111+
client_session.homeserver,
112+
);
113+
log!("{status_str}");
114+
Cx::post_action(LoginAction::Status(status_str));
115+
109116
// Build the client with the previous settings from the session.
110117
let client = Client::builder()
111118
.server_name_or_homeserver_url(client_session.homeserver)
@@ -115,7 +122,7 @@ pub async fn restore_session(
115122
.build()
116123
.await?;
117124

118-
let status_str = format!("Restoring previous login session for {}...", user_session.meta.user_id);
125+
let status_str = format!("Authenticating previous login session for {}...", user_session.meta.user_id);
119126
log!("{status_str}");
120127
Cx::post_action(LoginAction::Status(status_str));
121128

src/shared/avatar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ live_design! {
7070
visible: false,
7171
align: { x: 0.5, y: 0.5 }
7272
img = <Image> {
73-
fit: Smallest,
73+
fit: Stretch,
7474
width: Fill, height: Fill,
7575
source: (IMG_DEFAULT_AVATAR),
7676
draw_bg: {

src/sliding_sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ async fn async_main_loop(
903903
if let Some(session) = persistent_state::restore_session(specified_username).await.ok() {
904904
Some(session)
905905
} else {
906-
let status_err = "Error: failed to restore previous user session.";
906+
let status_err = "Error: failed to restore previous user session. Please login again.";
907907
log!("{status_err}");
908908
Cx::post_action(LoginAction::Status(status_err.to_string()));
909909

0 commit comments

Comments
 (0)