mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-21 23:50:45 +00:00
fix: handle tray panel clicks by dispatching actions to main window
- Tray panel click now asks main process to open main window and send jump/connect events - Main window listens for these events and switches tab or starts a new connection Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
80b6485d02
commit
a3ffefa067
6 files changed
+91
-8
No files matched your search
@@ -12,6 +12,16 @@ export const useTrayPanelBackend = () => {
|
||||
await bridge?.openMainWindow?.();
|
||||
}, []);
|
||||
|
||||
const jumpToSession = useCallback(async (sessionId: string) => {
|
||||
const bridge = netcattyBridge.get();
|
||||
await bridge?.jumpToSessionFromTrayPanel?.(sessionId);
|
||||
}, []);
|
||||
|
||||
const connectToHostFromTrayPanel = useCallback(async (hostId: string) => {
|
||||
const bridge = netcattyBridge.get();
|
||||
await bridge?.connectToHostFromTrayPanel?.(hostId);
|
||||
}, []);
|
||||
|
||||
const onTrayPanelCloseRequest = useCallback((callback: () => void) => {
|
||||
const bridge = netcattyBridge.get();
|
||||
return bridge?.onTrayPanelCloseRequest?.(callback);
|
||||
@@ -47,6 +57,8 @@ export const useTrayPanelBackend = () => {
|
||||
return {
|
||||
hideTrayPanel,
|
||||
openMainWindow,
|
||||
jumpToSession,
|
||||
connectToHostFromTrayPanel,
|
||||
onTrayPanelCloseRequest,
|
||||
onTrayPanelRefresh,
|
||||
onTrayPanelMenuData,
|
||||
|
||||
Reference in new issue
Block a user