Add is_linking() api
This commit is contained in:
parent
d7cd98ffe8
commit
3372bcb1ed
11
src/api.rs
11
src/api.rs
@ -231,6 +231,17 @@ pub fn create_new_device(birthday: u32, network_str: String) -> ApiResult<String
|
||||
Ok(our_address)
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn is_linking() -> ApiResult<bool> {
|
||||
let local_device = lock_local_device()?;
|
||||
|
||||
if local_device.is_linked() || local_device.is_linking() {
|
||||
Ok(true)
|
||||
} else {
|
||||
Ok(false)
|
||||
}
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn pair_device(commitment_tx: String, mut sp_addresses: Vec<String>) -> ApiResult<()> {
|
||||
let mut local_device = lock_local_device()?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user