From 443b64e76daa284a98fb22c74c1a878f92546229 Mon Sep 17 00:00:00 2001 From: core Date: Mon, 10 Apr 2023 15:39:34 -0400 Subject: [PATCH] fixup! fixup! fixup --- client/src/lib.rs | 14 +++++++------- web/play.html | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client/src/lib.rs b/client/src/lib.rs index 77a443a54f599e2bae5921d124cf7f38d091654a..9680b50a98e5fb42f348b57ef50f7a9383a3d122 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -31,7 +31,7 @@ extern { #[wasm_bindgen] pub async fn rust_init(gateway: &str, username: &str) -> Result<(), JsError> { - update_status("Starting logger..."); + set_status("Starting logger..."); console_log::init_with_level(Level::Debug).unwrap(); @@ -76,13 +76,13 @@ pub async fn main(gateway: &str, username: &str, backoff: i32) -> Result<(), Box wait_for(sleep(backoff * backoff * 1000)).await; if backoff > MAX_CONNECTION_TRIES { - update_status("Connection to server failed"); + set_status("Connection to server failed"); return Err("Hit backoff limit during reconnection attempt".into()); } if backoff == 1 { - update_status("Connecting to server..."); + set_status("Connecting to server..."); } else { - update_status(&format!("Connection failed, retrying... (try {}/10)", backoff)); + set_status(&format!("Connection failed, retrying... (try {}/10)", backoff)); } info!("FAST CONNECT: {}", gateway); @@ -112,7 +112,7 @@ pub async fn main(gateway: &str, username: &str, backoff: i32) -> Result<(), Box trace!("Split stream, handshaking with server"); - update_status("Handshaking with server..."); + set_status("Handshaking with server..."); send!(client_data.tx, &MessageC2S::Hello { next_state: State::Play, @@ -144,7 +144,7 @@ pub async fn main(gateway: &str, username: &str, backoff: i32) -> Result<(), Box CLIENT.write()?.client_data = Some(client_data); - update_status(&format!("Connected! Username: {}", username)); + set_status(&format!("Connected! Username: {}", username)); Ok(()) } @@ -198,7 +198,7 @@ pub async fn update_socket() -> Result<(), JsError> { } #[wasm_bindgen] -pub fn update_status(new_status: &str) { +pub fn set_status(new_status: &str) { let window: Window = web_sys::window().expect("no global `window` exists"); let document = window.document().expect("should have a document on window"); let status = document.get_element_by_id("status").expect("statusbox does not exist"); diff --git a/web/play.html b/web/play.html index a731f188b2f1a9e8d77a240dcba9dba99e5c5bf6..70d9997331989aba521fdf556501d81391758956 100644 --- a/web/play.html +++ b/web/play.html @@ -21,7 +21,7 @@