Skip to content

Commit 825d606

Browse files
committed
Fix create torrent window not matching theme
1 parent bf919c6 commit 825d606

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

src-tauri/src/commands.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::fs;
1919
use base64::{engine::general_purpose::STANDARD as b64engine, Engine as _};
2020
use font_loader::system_fonts;
2121
use lava_torrent::torrent::v1::Torrent;
22-
use tauri::{Emitter, Manager, State};
22+
use tauri::{Emitter, EventTarget, State};
2323

2424
use crate::{
2525
createtorrent::{CreateCheckResult, CreationRequestsHandle, TorrentCreateInfo},
@@ -268,15 +268,14 @@ pub async fn pass_to_window(
268268
to: String,
269269
payload: String,
270270
) {
271-
if let Some(dest) = app_handle.get_webview_window(to.as_str()) {
272-
let _ = dest.emit(
273-
"pass-from-window",
274-
PassEventData {
275-
from: window.label().to_string(),
276-
payload,
277-
},
278-
);
279-
}
271+
let _ = app_handle.emit_to(
272+
EventTarget::window(to.as_str()),
273+
"pass-from-window",
274+
PassEventData {
275+
from: window.label().to_string(),
276+
payload,
277+
},
278+
);
280279
}
281280

282281
#[tauri::command]

src-tauri/src/main.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@ fn setup(app: &mut App) -> Result<(), Box<dyn std::error::Error>> {
120120
let listener_lock = listener_lock2.clone();
121121
async_runtime::spawn(async move {
122122
let mut listener = listener_lock.write().await;
123-
println!("Grabbed listener lock to pause");
124123
listener.pause().await;
125-
println!("Listener lock to pause released");
126124
});
127125
});
128126
tray::toggle_main_window(&app, None);

0 commit comments

Comments
 (0)