Skip to content

Commit bbdb823

Browse files
authored
fix(webview/slack): first-load + Google auth (tinyhumansai#1036) (tinyhumansai#1249)
1 parent 31cd0ab commit bbdb823

4 files changed

Lines changed: 359 additions & 27 deletions

File tree

app/src-tauri/src/cdp/session.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use tokio::task::JoinHandle;
2222
use tokio::time::sleep;
2323

2424
use super::{browser_ws_url, find_page_target_where, CdpConn};
25-
use crate::webview_accounts::emit_load_finished;
25+
use crate::webview_accounts::{emit_load_finished, RevealTrigger};
2626

2727
/// Backoff between failed attach attempts / reconnects. Intentionally
2828
/// short — once the webview is open, the target usually shows up within
@@ -161,7 +161,13 @@ pub fn spawn_session<R: Runtime>(
161161
let real_url = real_url.clone();
162162
tokio::spawn(async move {
163163
sleep(LOAD_TIMEOUT).await;
164-
emit_load_finished(&app, &account_id, "timeout", &real_url);
164+
emit_load_finished(
165+
&app,
166+
&account_id,
167+
"timeout",
168+
&real_url,
169+
RevealTrigger::Watchdog,
170+
);
165171
})
166172
};
167173
let session = tokio::spawn(async move { run_session_forever(app, account_id, real_url).await });
@@ -449,7 +455,13 @@ async fn run_session_cycle<R: Runtime>(
449455
let cb_real_url = real_url.to_string();
450456
cdp.pump_events(&session_id, move |method, _params| {
451457
if method == "Page.loadEventFired" {
452-
emit_load_finished(&cb_app, &cb_account_id, "finished", &cb_real_url);
458+
emit_load_finished(
459+
&cb_app,
460+
&cb_account_id,
461+
"finished",
462+
&cb_real_url,
463+
RevealTrigger::Load,
464+
);
453465
}
454466
})
455467
.await

0 commit comments

Comments
 (0)