async fn dashboard_call(cmd: String, data: JsValue, state: Rc<State>) {
        log("DASHBOARD_CALL");
        // Bind worker to local variable
        let worker = state.worker();
        // Perform operation
        match cmd.as_ref() {
            "savePassword" => {
                worker.save_password(data).await;
            }
            "updatePassword" => {
                worker.update_password(data).await;
            }
            "deletePassword" => {
                worker.delete_password(data).await;
            }
            "undoDeletePassword" => {
                worker.undo_delete_password(data).await;
            }
            "getPassword" | "getPasswordForUpdate" |
            "getPasswordToClipboard" | "getPasswordAndRedirect" => {
                worker.get_password(cmd, data).await;
            }
            "saveCategory" => {
                worker.save_category(data).await;
            }
            "updateCategory" => {
                worker.update_category(data).await;
            }
            "deleteCategories" => {
                worker.delete_categories(data).await;
            }
            "undoDeleteCategories" => {
                worker.undo_delete_categories(data).await;
            },
            "network" => {
                console_log!("NETWORK: {:?}", &data);
            }
            "unregister" => {
                worker.reset().await;
                state.set_mode(None);
            }
            _ => {}
        }
    }
/// Process calls on the dashboard page.
Process calls on the dashboard page.
Process calls on the dashboard page .
async fn dashboard_call(cmd: String, data: JsValue, state: Rc<State>) {
        log("DASHBOARD_CALL");
        // Bind worker to local variable
        let worker = state.worker();
        // Perform operation
        match cmd.as_ref() {
            "savePassword" => {
                worker.save_password(data).await;
            }
            "updatePassword" => {
                worker.update_password(data).await;
            }
            "deletePassword" => {
                worker.delete_password(data).await;
            }
            "undoDeletePassword" => {
                worker.undo_delete_password(data).await;
            }
            "getPassword" | "getPasswordForUpdate" |
            "getPasswordToClipboard" | "getPasswordAndRedirect" => {
                worker.get_password(cmd, data).await;
            }
            "saveCategory" => {
                worker.save_category(data).await;
            }
            "updateCategory" => {
                worker.update_category(data).await;
            }
            "deleteCategories" => {
                worker.delete_categories(data).await;
            }
            "undoDeleteCategories" => {
                worker.undo_delete_categories(data).await;
            },
            "network" => {
                console_log!("NETWORK: {:?}", &data);
            }
            "unregister" => {
                worker.reset().await;
                state.set_mode(None);
            }
            _ => {}
        }
    }
async fn dashboard_call ( cmd : String , data : JsValue , state : Rc < State > ) { log ( " " ) ; // Bind worker to local variable let worker = state . worker ( ) ; // Perform operation match cmd . as_ref ( ) { " " => { worker . save_password ( data ) . await ; } " " => { worker . update_password ( data ) . await ; } " " => { worker . delete_password ( data ) . await ; } " " => { worker . undo_delete_password ( data ) . await ; } " " | " " | " " | " " => { worker . get_password ( cmd , data ) . await ; } " " => { worker . save_category ( data ) . await ; } " " => { worker . update_category ( data ) . await ; } " " => { worker . delete_categories ( data ) . await ; } " " => { worker . undo_delete_categories ( data ) . await ; } , " " => { console_log ! ( " " data ) ; } " " => { worker . reset ( ) . await ; state . set_mode ( None ) ; } _ => { } } }
Process calls on the dashboard page.
Process calls on the dashboard page .
cmd
String
data
JsValue
state
Rc<State>
cmd
String
data
JsValue
state
Rc<State>