mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
dont send message back to main if that's where it came from originally
This commit is contained in:
@@ -8,14 +8,20 @@ export class ElectronRendererMessagingService implements MessagingService {
|
|||||||
constructor(private broadcasterService: BroadcasterService) {
|
constructor(private broadcasterService: BroadcasterService) {
|
||||||
ipcRenderer.on('messagingService', async (event: any, message: any) => {
|
ipcRenderer.on('messagingService', async (event: any, message: any) => {
|
||||||
if (message.command) {
|
if (message.command) {
|
||||||
this.send(message.command, message);
|
this.sendMessage(message.command, message, false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
send(subscriber: string, arg: any = {}) {
|
send(subscriber: string, arg: any = {}) {
|
||||||
|
this.sendMessage(subscriber, arg, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private sendMessage(subscriber: string, arg: any = {}, toMain: boolean) {
|
||||||
const message = Object.assign({}, { command: subscriber }, arg);
|
const message = Object.assign({}, { command: subscriber }, arg);
|
||||||
ipcRenderer.send('messagingService', message);
|
|
||||||
this.broadcasterService.send(message);
|
this.broadcasterService.send(message);
|
||||||
|
if (toMain) {
|
||||||
|
ipcRenderer.send('messagingService', message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user