pass dispatcher through to electron, on a whitelist basis

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2017-05-22 18:30:45 +01:00
parent a9b5282ba3
commit 755c66b9f1

View file

@ -54,7 +54,19 @@ function platformFriendlyName(): string {
} }
} }
function _onAction(payload: Object) {
// Whitelist payload actions, no point sending most across
if (['call_state'].includes(payload.action)) {
ipcRenderer.send('app_onAction', payload);
}
}
export default class ElectronPlatform extends VectorBasePlatform { export default class ElectronPlatform extends VectorBasePlatform {
constructor() {
super();
dis.register(_onAction);
}
setNotificationCount(count: number) { setNotificationCount(count: number) {
if (this.notificationCount === count) return; if (this.notificationCount === count) return;
super.setNotificationCount(count); super.setNotificationCount(count);