refactor(Navbar): improve WindowControls visibility and clean up event listener management (#10066)
* refactor(Navbar): improve WindowControls visibility and clean up event listener management - Updated Navbar component to conditionally render WindowControls based on minappShow state. - Refactored IPC event listener management in preload script for better clarity and performance. * feat(WindowControls): replace custom restore icon with a new SVG component - Introduced a new `WindowRestoreIcon` component with enhanced SVG structure and styling. - Updated `WindowControls` to use the new `WindowRestoreIcon` for better visual consistency and scalability. * feat(WindowControls): update WindowRestoreIcon SVG for improved design - Enhanced the SVG structure of the `WindowRestoreIcon` component with updated dimensions and styling for better visual appeal. - Adjusted the path and rectangle properties to refine the icon's appearance and maintain consistency across the application. * lint error
This commit is contained in:
@@ -455,9 +455,10 @@ const api = {
|
||||
isMaximized: (): Promise<boolean> => ipcRenderer.invoke(IpcChannel.Windows_IsMaximized),
|
||||
onMaximizedChange: (callback: (isMaximized: boolean) => void): (() => void) => {
|
||||
const channel = IpcChannel.Windows_MaximizedChanged
|
||||
ipcRenderer.on(channel, (_, isMaximized: boolean) => callback(isMaximized))
|
||||
const listener = (_: Electron.IpcRendererEvent, isMaximized: boolean) => callback(isMaximized)
|
||||
ipcRenderer.on(channel, listener)
|
||||
return () => {
|
||||
ipcRenderer.removeAllListeners(channel)
|
||||
ipcRenderer.removeListener(channel, listener)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user