fix listen_global not listening to events with a window label (#2272)

This commit is contained in:
FabianLars 2021-07-23 15:23:38 +02:00 committed by GitHub
parent 31685c9f9d
commit a8c1de5547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"tauri": patch
---
Fixes `app.listen_global` not receiving events emitted in javascript.

View File

@ -194,7 +194,7 @@ impl Listeners {
Ok(lock) => {
if let Some(handlers) = lock.get(event) {
for (&id, handler) in handlers {
if window.is_none() || window == handler.window {
if handler.window.is_none() || window == handler.window {
maybe_pending = true;
(handler.callback)(self::Event {
id,