mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-27 17:31:36 -06:00
Merge pull request #1176 from johankwarnmarksymphony/SDA-2916
fix: sda-2916 got several listeners to screen-source-select, remove all listeners w…
This commit is contained in:
commit
c6354bf3f2
@ -1218,7 +1218,7 @@ export class WindowHandler {
|
||||
this.addWindow(opts.winKey, this.screenPickerWindow);
|
||||
});
|
||||
|
||||
ipcMain.on('screen-source-select', (_event, source) => {
|
||||
const screenSourceSelect = (_event, source) => {
|
||||
if (source != null) {
|
||||
logger.info(`window-handler: screen-source-select`, source, id);
|
||||
|
||||
@ -1229,12 +1229,15 @@ export class WindowHandler {
|
||||
timeoutValue,
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
ipcMain.on('screen-source-select', screenSourceSelect);
|
||||
|
||||
ipcMain.once('screen-source-selected', (_event, source) => {
|
||||
logger.info(`window-handler: screen-source-selected`, source, id);
|
||||
|
||||
this.drawScreenShareIndicatorFrame(source);
|
||||
if (source == null) {
|
||||
this.execCmd(this.screenShareIndicatorFrameUtil, []);
|
||||
}
|
||||
|
||||
window.send('start-share' + id, source);
|
||||
if (this.screenPickerWindow && windowExists(this.screenPickerWindow)) {
|
||||
@ -1242,7 +1245,7 @@ export class WindowHandler {
|
||||
}
|
||||
});
|
||||
this.screenPickerWindow.once('closed', () => {
|
||||
this.execCmd(this.screenShareIndicatorFrameUtil, []);
|
||||
ipcMain.removeListener('screen-source-select', screenSourceSelect);
|
||||
this.removeWindow(opts.winKey);
|
||||
this.screenPickerWindow = null;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user