mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 15:25:46 +00:00
refactor(app): move Tauri IPC bridge hooks (tauriBridge/) into app/ where the shell composes them
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { useEffect } from 'react';
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
import { useAuthStore } from '@/store/authStore';
|
||||
|
||||
/** Sync tray-icon visibility with the user's stored setting. Runs once on mount
|
||||
* (initial sync) and again whenever the setting changes. */
|
||||
export function useTrayIconSync() {
|
||||
const showTrayIcon = useAuthStore(s => s.showTrayIcon);
|
||||
useEffect(() => {
|
||||
invoke('toggle_tray_icon', { show: showTrayIcon }).catch(console.error);
|
||||
}, [showTrayIcon]);
|
||||
}
|
||||
Reference in New Issue
Block a user