mirror of
				https://github.com/zulip/zulip-desktop.git
				synced 2025-11-04 05:53:21 +00:00 
			
		
		
		
	tray: Be robust in case there’s no active webview.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
		@@ -223,9 +223,12 @@ function toggleTray(): void {
 | 
				
			|||||||
    ConfigUtil.setConfigItem("trayIcon", true);
 | 
					    ConfigUtil.setConfigItem("trayIcon", true);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const selector = "webview:not([class*=disabled])";
 | 
					  const webview = document.querySelector<WebviewTag>(
 | 
				
			||||||
  const webview: WebviewTag = document.querySelector(selector)!;
 | 
					    "webview:not([class*=disabled])",
 | 
				
			||||||
  ipcRenderer.sendTo(webview.getWebContentsId(), "toggle-tray", state);
 | 
					  );
 | 
				
			||||||
 | 
					  if (webview !== null) {
 | 
				
			||||||
 | 
					    ipcRenderer.sendTo(webview.getWebContentsId(), "toggle-tray", state);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ipcRenderer.on("toggletray", toggleTray);
 | 
					ipcRenderer.on("toggletray", toggleTray);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user