mirror of https://github.com/tauri-apps/tauri
fix(event): handle AnyLabel listeners in `emit_to` (#11581)
closes #11561
This commit is contained in:
parent
c33bbf4574
commit
f8994b214e
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"tauri": "patch:bug"
|
||||
---
|
||||
|
||||
Fix listeners created with `EventTarget::AnyLabel` never receiving events.
|
|
@ -597,7 +597,31 @@ impl<R: Runtime> AppManager<R> {
|
|||
} => self.emit_filter(event, payload, |t| match t {
|
||||
EventTarget::Window { label }
|
||||
| EventTarget::Webview { label }
|
||||
| EventTarget::WebviewWindow { label } => label == &target_label,
|
||||
| EventTarget::WebviewWindow { label }
|
||||
| EventTarget::AnyLabel { label } => label == &target_label,
|
||||
_ => false,
|
||||
}),
|
||||
|
||||
EventTarget::Window {
|
||||
label: target_label,
|
||||
} => self.emit_filter(event, payload, |t| match t {
|
||||
EventTarget::AnyLabel { label } | EventTarget::Window { label } => label == &target_label,
|
||||
_ => false,
|
||||
}),
|
||||
|
||||
EventTarget::Webview {
|
||||
label: target_label,
|
||||
} => self.emit_filter(event, payload, |t| match t {
|
||||
EventTarget::AnyLabel { label } | EventTarget::Webview { label } => label == &target_label,
|
||||
_ => false,
|
||||
}),
|
||||
|
||||
EventTarget::WebviewWindow {
|
||||
label: target_label,
|
||||
} => self.emit_filter(event, payload, |t| match t {
|
||||
EventTarget::AnyLabel { label } | EventTarget::WebviewWindow { label } => {
|
||||
label == &target_label
|
||||
}
|
||||
_ => false,
|
||||
}),
|
||||
|
||||
|
|
Loading…
Reference in New Issue