mirror of
https://github.com/bitwarden/browser
synced 2025-12-27 05:33:59 +00:00
16 lines
537 B
TypeScript
16 lines
537 B
TypeScript
import { ipcRenderer } from 'electron';
|
|
|
|
import { MessagingService } from 'jslib/abstractions';
|
|
|
|
import { BroadcasterService } from '../app/services/broadcaster.service';
|
|
|
|
export class DesktopMessagingService implements MessagingService {
|
|
constructor(private broadcasterService: BroadcasterService) { }
|
|
|
|
send(subscriber: string, arg: any = {}) {
|
|
const message = Object.assign({}, { command: subscriber }, arg);
|
|
ipcRenderer.send('messagingService', message);
|
|
this.broadcasterService.emit(message);
|
|
}
|
|
}
|