Update ElectronProvider.tsx
This commit is contained in:
@@ -56,7 +56,7 @@ export function ElectronProvider({ children }: { children: React.ReactNode }) {
|
|||||||
|
|
||||||
// handle window focus and unfocus
|
// handle window focus and unfocus
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
window.electronAPI.on(Channels.ON_WINDOW_BLUR, () => {
|
const blurListener = window.electronAPI.on(Channels.ON_WINDOW_BLUR, () => {
|
||||||
console.log(
|
console.log(
|
||||||
'window blurring now, should be always on top and then ill tell main process to change dimensions',
|
'window blurring now, should be always on top and then ill tell main process to change dimensions',
|
||||||
);
|
);
|
||||||
@@ -66,10 +66,14 @@ export function ElectronProvider({ children }: { children: React.ReactNode }) {
|
|||||||
// setDesktopMode('overlayOnly');
|
// setDesktopMode('overlayOnly');
|
||||||
});
|
});
|
||||||
|
|
||||||
window.electronAPI.on(Channels.ON_WINDOW_FOCUS, () => {
|
const focusListener = window.electronAPI.on(Channels.ON_WINDOW_FOCUS, () => {
|
||||||
console.log('window focusing now');
|
console.log('window focusing now');
|
||||||
setIsWindowFocused(true);
|
setIsWindowFocused(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
// window.removeEventListener(Channels.ON_WINDOW_BLUR, blurListener);
|
||||||
|
};
|
||||||
}, [setDesktopMode, setIsWindowFocused]);
|
}, [setDesktopMode, setIsWindowFocused]);
|
||||||
|
|
||||||
const handleToggleDesktopMode = useCallback(() => {
|
const handleToggleDesktopMode = useCallback(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user