perf: performance improvements 1
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* The display-media request handler is a session-level singleton. Registering
|
||||
* it inside `createWindow()` without a guard re-installed a fresh handler
|
||||
* (holding fresh closures) every time the window was recreated from the tray
|
||||
* or a deep link. Registration happens at most once per app run.
|
||||
*/
|
||||
export function shouldRegisterDisplayMediaHandler(
|
||||
platform: NodeJS.Platform,
|
||||
alreadyConfigured: boolean
|
||||
): boolean {
|
||||
if (alreadyConfigured) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return platform === 'linux' || platform === 'win32';
|
||||
}
|
||||
Reference in New Issue
Block a user