Skip to content

Commit 755c66b

Browse files
committed
pass dispatcher through to electron, on a whitelist basis
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
1 parent a9b5282 commit 755c66b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎src/vector/platform/ElectronPlatform.js‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,19 @@ function platformFriendlyName(): string {
5454
}
5555
}
5656

57+
function _onAction(payload: Object) {
58+
// Whitelist payload actions, no point sending most across
59+
if (['call_state'].includes(payload.action)) {
60+
ipcRenderer.send('app_onAction', payload);
61+
}
62+
}
63+
5764
export default class ElectronPlatform extends VectorBasePlatform {
65+
constructor() {
66+
super();
67+
dis.register(_onAction);
68+
}
69+
5870
setNotificationCount(count: number) {
5971
if (this.notificationCount === count) return;
6072
super.setNotificationCount(count);

0 commit comments

Comments
 (0)