]> git.proxmox.com Git - proxmox.git/commitdiff
add special impl for epoch_i64() on target_arch="wasm32"
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 7 Aug 2023 09:54:02 +0000 (11:54 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 7 Aug 2023 09:56:15 +0000 (11:56 +0200)
proxmox-login/src/ticket.rs

index 5784ef9ce0f399692edb3b86a14deb8cd0ca78c8..9f98cc1f181f25b5f74bbcde097de80faba6f75e 100644 (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};