fix(core): fix wrong file drop events (#2300)

This commit is contained in:
FabianLars 2021-07-31 00:58:09 +02:00 committed by GitHub
parent 426a6b4996
commit c2b0fe1ce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -0,0 +1,6 @@
---
"tauri": patch
"api": patch
---
Fixes file drop events being swapped (`file-drop-hover` on drop and `file-drop` on hover).

View File

@ -396,8 +396,8 @@ impl<R: Runtime> WindowManager<R> {
crate::async_runtime::block_on(async move {
let window = Window::new(manager.clone(), window, app_handle);
let _ = match event {
FileDropEvent::Hovered(paths) => window.emit("tauri://file-drop", Some(paths)),
FileDropEvent::Dropped(paths) => window.emit("tauri://file-drop-hover", Some(paths)),
FileDropEvent::Hovered(paths) => window.emit("tauri://file-drop-hover", Some(paths)),
FileDropEvent::Dropped(paths) => window.emit("tauri://file-drop", Some(paths)),
FileDropEvent::Cancelled => window.emit("tauri://file-drop-cancelled", Some(())),
_ => unimplemented!(),
};