"set palette" function
This commit is contained in:
10
src/lib.rs
10
src/lib.rs
@@ -94,6 +94,16 @@ pub fn set_room_name(room_name: String) {
|
||||
}
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn set_palette(palette_id: String) {
|
||||
let mut state = STATE.lock().unwrap();
|
||||
|
||||
match palette_id.is_empty() {
|
||||
true => { state.palette = None },
|
||||
false => { state.palette = Some(palette_id) },
|
||||
}
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn add_room() -> String {
|
||||
let mut state = STATE.lock().expect("Couldn't lock application state");
|
||||
|
||||
Reference in New Issue
Block a user