Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Workaound window sometimes only showing a white background #459

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ chrono = "0.4.38"
console_error_panic_hook = "0.1.7"
console_log = "1.0.0"
futures = "0.3.30"
gloo-timers = { version = "0.3.0", features = ["futures"] }
icondata = "0.4.0"
js-sys = "0.3.70"
leptos = { version = "0.6.15", features = ["csr"] }
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ pub fn run() {
let splashscreen_window = app.get_webview_window("splashscreen").unwrap();
let main_window = app.get_webview_window("main").unwrap();
tauri::async_runtime::spawn(async move {
tokio::time::sleep(Duration::from_secs(3)).await;
tokio::time::sleep(Duration::from_millis(1_500)).await;
splashscreen_window.close().unwrap();
main_window.show().unwrap();
});
Expand Down
3 changes: 3 additions & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use gloo_timers::future::TimeoutFuture;
use leptos::*;

use std::{
Expand Down Expand Up @@ -979,6 +980,8 @@ pub struct BrowsingSignal(RwSignal<bool>);
pub struct IsDesktopSignal(RwSignal<bool>);

async fn get_is_desktop(writer: RwSignal<bool>) {
// Workaround for is_dekstop request sometimes failing and resulting in a blank window
TimeoutFuture::new(50).await;
let is_desktop = invoke::<bool>("is_desktop", &()).await;
writer.update(|v| *v = is_desktop);
}
Expand Down