Просмотр исходного кода

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

FabianLars 4 лет назад
Родитель
Сommit
a8c1de5547
2 измененных файлов с 6 добавлено и 1 удалено
  1. 5 0
      .changes/fix-listen_global-not-getting-events.md
  2. 1 1
      core/tauri/src/event.rs

+ 5 - 0
.changes/fix-listen_global-not-getting-events.md

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

+ 1 - 1
core/tauri/src/event.rs

@@ -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,