Set user language to new recipe + cleaning
This commit is contained in:
parent
8b4b788562
commit
03ebbb74fa
12 changed files with 73 additions and 86 deletions
|
|
@ -1,5 +1,4 @@
|
|||
use gloo::{
|
||||
console::log,
|
||||
events::EventListener,
|
||||
net::http::Request,
|
||||
utils::{document, window},
|
||||
|
|
|
|||
|
|
@ -5,11 +5,7 @@ mod request;
|
|||
mod toast;
|
||||
mod utils;
|
||||
|
||||
use gloo::{
|
||||
console::log,
|
||||
events::EventListener,
|
||||
utils::{document, window},
|
||||
};
|
||||
use gloo::{events::EventListener, utils::window};
|
||||
use utils::by_id;
|
||||
use wasm_bindgen::prelude::*;
|
||||
use wasm_bindgen_futures::spawn_local;
|
||||
|
|
@ -17,24 +13,10 @@ use web_sys::HtmlSelectElement;
|
|||
|
||||
use common::ron_api;
|
||||
|
||||
// #[wasm_bindgen]
|
||||
// extern "C" {
|
||||
// fn alert(s: &str);
|
||||
// }
|
||||
|
||||
// #[wasm_bindgen]
|
||||
// pub fn greet(name: &str) {
|
||||
// alert(&format!("Hello, {}!", name));
|
||||
// console::log_1(&"Hello bg".into());
|
||||
// }
|
||||
|
||||
#[wasm_bindgen(start)]
|
||||
pub fn main() -> Result<(), JsValue> {
|
||||
console_error_panic_hook::set_once();
|
||||
|
||||
// let window = web_sys::window().expect("no global `window` exists");
|
||||
// let document = window.document().expect("should have a document on window");
|
||||
|
||||
let location = window().location().pathname()?;
|
||||
let path: Vec<&str> = location.split('/').skip(1).collect();
|
||||
|
||||
|
|
@ -56,8 +38,6 @@ pub fn main() -> Result<(), JsValue> {
|
|||
let _ = request::put::<(), _>("set_lang", body).await;
|
||||
let _ = window().location().reload();
|
||||
});
|
||||
|
||||
// log!(lang);
|
||||
})
|
||||
.forget();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use futures::channel::mpsc;
|
||||
use futures::stream::Stream;
|
||||
use gloo::{console::log, events::EventListener, net::http::Request, utils::document};
|
||||
use gloo::events::EventListener;
|
||||
use std::{
|
||||
future::Future,
|
||||
pin::Pin,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue