diff --git a/src/api.rs b/src/api.rs index 1e0c518..d19d069 100644 --- a/src/api.rs +++ b/src/api.rs @@ -231,6 +231,17 @@ pub fn create_new_device(birthday: u32, network_str: String) -> ApiResult ApiResult { + 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) -> ApiResult<()> { let mut local_device = lock_local_device()?;