register tx early (#1114)

This commit is contained in:
Logan McNaughton
2026-06-23 16:52:27 +02:00
committed by GitHub
parent 70b9d20c64
commit ba0a21feca
+3 -2
View File
@@ -450,6 +450,9 @@ fn open_uri_on_jvm(
}
pub async fn select_rom(rom_dir: slint::SharedString) -> Option<std::path::PathBuf> {
let (tx, rx) = tokio::sync::oneshot::channel::<Option<std::path::PathBuf>>();
SELECT_ROM_TX.lock().await.replace(tx);
if let Ok(app) = ANDROID_APP.lock()
&& let Some(app) = app.as_ref()
{
@@ -463,8 +466,6 @@ pub async fn select_rom(rom_dir: slint::SharedString) -> Option<std::path::PathB
eprintln!("Android app not initialized");
return None;
}
let (tx, rx) = tokio::sync::oneshot::channel::<Option<std::path::PathBuf>>();
SELECT_ROM_TX.lock().await.replace(tx);
rx.await.unwrap_or(None)
}