소스 검색

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

FabianLars 4 년 전
부모
커밋
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,