mirror of
https://github.com/nimbold/Firelink.git
synced 2026-09-10 09:45:44 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7744b386d2 | |||
| 639f5bf091 | |||
| 97f15dee37 | |||
| 8d1cde8d2c |
@@ -18200,9 +18200,12 @@ fn toggle_log_pause(caller: tauri::WebviewWindow, pause: bool) -> Result<(), Str
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn is_log_paused(caller: tauri::WebviewWindow) -> bool {
|
||||
properties_window::ensure_main_window(&caller).is_ok()
|
||||
&& LOG_PAUSED.load(std::sync::atomic::Ordering::Relaxed)
|
||||
fn is_log_paused() -> bool {
|
||||
// This read is needed during renderer bootstrap, including by standalone
|
||||
// Properties windows. Avoid extracting a WebviewWindow here: on Windows,
|
||||
// WebView2 can invoke the command while its host is still initializing.
|
||||
// Mutating logging commands remain restricted to the main window below.
|
||||
LOG_PAUSED.load(std::sync::atomic::Ordering::Relaxed)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -19900,7 +19903,6 @@ pub fn run() {
|
||||
mark_main_window_startup_complete(app_handle);
|
||||
#[cfg(target_os = "windows")]
|
||||
reveal_main_window(app_handle);
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
restore_pending_main_window(app_handle);
|
||||
}
|
||||
#[cfg(target_os = "macos")]
|
||||
|
||||
+14
-3
@@ -1,4 +1,15 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
|
||||
const rootElement = document.getElementById("root");
|
||||
if (rootElement) {
|
||||
rootElement.textContent = "Firelink startup control";
|
||||
}
|
||||
if (rootElement) rootElement.textContent = "Firelink startup control";
|
||||
|
||||
const documentLoaded = new Promise<void>((resolve) => {
|
||||
const releaseAfterNativeLoad = () => window.setTimeout(resolve, 0);
|
||||
if (document.readyState === "complete") releaseAfterNativeLoad();
|
||||
else window.addEventListener("load", releaseAfterNativeLoad, { once: true });
|
||||
});
|
||||
|
||||
void documentLoaded.then(async () => {
|
||||
await invoke<boolean>("is_log_paused");
|
||||
if (rootElement) rootElement.textContent = "Firelink post-load log read";
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user