diff --git a/ng-app/package.json b/ng-app/package.json index 61a2d7b..7b1b8eb 100644 --- a/ng-app/package.json +++ b/ng-app/package.json @@ -6,17 +6,18 @@ "scripts": { "dev": "vite", "webdev": "cross-env NG_APP_WEB=1 TAURI_DEBUG=1 vite", - "webbuild": "cross-env NG_APP_WEB=1 vite build", + "webbuild": "cross-env NG_APP_WEB=1 vite build && rm ./dist/assets/*.svg", "filebuild": "cross-env NG_APP_WEB=1 NG_APP_FILE=1 vite build && node prepare-app-file.cjs", "filebuilddebug": "cross-env NG_APP_WEB=1 NG_APP_FILE=1 TAURI_DEBUG=1 vite build -m debug", - "build": "vite build", + "build": "vite build && rm ./dist/assets/*.svg", + "buildfile": "cross-env NG_APP_FILE=1 vite build && rm -r ./dist/assets", "preview": "vite preview", "check": "svelte-check --tsconfig ./tsconfig.json", "tauri": "tauri" }, "dependencies": { "@popperjs/core": "^2.11.8", - "@tauri-apps/api": "2.0.0-alpha.4", + "@tauri-apps/api": "2.0.0-alpha.5", "@tauri-apps/plugin-window": "2.0.0-alpha.0", "async-proxy": "^0.4.1", "classnames": "^2.3.2", diff --git a/ng-app/src-tauri/Cargo.toml b/ng-app/src-tauri/Cargo.toml index b2f7c6a..9d75607 100644 --- a/ng-app/src-tauri/Cargo.toml +++ b/ng-app/src-tauri/Cargo.toml @@ -17,7 +17,7 @@ crate-type = ["staticlib", "cdylib", "rlib"] tauri-build = { version = "2.0.0-alpha.5", features = [] } [dependencies] -tauri = { version = "2.0.0-alpha.9", features = [] } +tauri = { version = "2.0.0-alpha.10", features = [] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" p2p-repo = { path = "../../p2p-repo" } diff --git a/ng-app/src-tauri/src/lib.rs b/ng-app/src-tauri/src/lib.rs index d2b33dc..f5f277b 100644 --- a/ng-app/src-tauri/src/lib.rs +++ b/ng-app/src-tauri/src/lib.rs @@ -208,7 +208,8 @@ async fn open_window( ) -> Result<(), ()> { log_debug!("open window url {:?}", url); let already_exists = app.get_window(&label); - if (already_exists.is_some()) { + #[cfg(desktop)] + if already_exists.is_some() { let _ = already_exists.unwrap().close(); std::thread::sleep(std::time::Duration::from_secs(1)); } @@ -332,6 +333,7 @@ impl AppBuilder { app.ipc_scope().configure_remote_access( RemoteDomainAccessScope::new(domain) .add_window("registration") + .add_window("main") .add_plugins(["window", "event"]), ); } diff --git a/ng-app/src/App.svelte b/ng-app/src/App.svelte index ebd63c6..56ae93b 100644 --- a/ng-app/src/App.svelte +++ b/ng-app/src/App.svelte @@ -11,7 +11,7 @@
diff --git a/ngone/src/store/dynpeer.rs b/ngone/src/store/dynpeer.rs index 1b7dc4b..3991455 100644 --- a/ngone/src/store/dynpeer.rs +++ b/ngone/src/store/dynpeer.rs @@ -55,7 +55,7 @@ impl<'a> DynPeer<'a> { if acc.exists() { return Err(StorageError::BackendError); } - store.write_transaction(&|tx| { + store.write_transaction(&mut |tx| { tx.put( Self::PREFIX, &to_vec(&id)?, diff --git a/ngone/src/store/wallet_record.rs b/ngone/src/store/wallet_record.rs index 905e0e7..38425a2 100644 --- a/ngone/src/store/wallet_record.rs +++ b/ngone/src/store/wallet_record.rs @@ -55,7 +55,7 @@ impl<'a> WalletRecord<'a> { if wallet.exists() { return Err(StorageError::BackendError); } - store.write_transaction(&|tx| { + store.write_transaction(&mut |tx| { tx.put( Self::PREFIX, &to_vec(&id)?, diff --git a/p2p-broker/src/broker_store/wallet.rs b/p2p-broker/src/broker_store/wallet.rs index fc12933..170ea41 100644 --- a/p2p-broker/src/broker_store/wallet.rs +++ b/p2p-broker/src/broker_store/wallet.rs @@ -76,7 +76,7 @@ impl<'a> Wallet<'a> { } pub fn get_or_create_overlay_key(&self, overlay: &OverlayId) -> Result