add special impl for epoch_i64() on target_arch="wasm32"

This commit is contained in:
Dietmar Maurer 2023-08-07 11:54:02 +02:00
parent 17f5eac57a
commit ffa64bead7

View File

@ -240,6 +240,12 @@ impl Authentication {
}
}
#[cfg(target_arch="wasm32")]
fn epoch_i64() -> i64 {
(js_sys::Date::now() / 1000.0) as i64;
}
#[cfg(not(target_arch="wasm32"))]
fn epoch_i64() -> i64 {
use std::time::{SystemTime, UNIX_EPOCH};