Skip to content

Commit

Permalink
fix(powermonitor): Fix crash due to non-initialized postis channel
Browse files Browse the repository at this point in the history
  • Loading branch information
horymury authored Mar 26, 2020
1 parent 83fd972 commit 8dc9506
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jitsi-meet-electron-utils",
"version": "2.0.1",
"version": "2.0.2",
"description": "Utilities for jitsi-meet-electron project",
"main": "index.js",
"scripts": {
Expand Down
9 changes: 4 additions & 5 deletions powermonitor/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ function _sendEvent(event) {
*/
function _sendMessage(message) {
_channel.send({
method: 'message',
params: message
method: 'message',
params: message
});
}

Expand Down Expand Up @@ -89,6 +89,8 @@ module.exports = function setupPowerMonitorRender(api) {
scope: 'jitsi-power-monitor'
});
_channel.ready(() => {
ipcRenderer.on(POWER_MONITOR_QUERIES_CHANNEL, queriesChannelListener);
ipcRenderer.on(POWER_MONITOR_EVENTS_CHANNEL, eventsChannelListener);
_channel.listen('message', message => {
const { name } = message.data;
if(name === POWER_MONITOR_MESSAGE_NAME) {
Expand All @@ -97,7 +99,4 @@ module.exports = function setupPowerMonitorRender(api) {
});
});
});

ipcRenderer.on(POWER_MONITOR_QUERIES_CHANNEL, queriesChannelListener);
ipcRenderer.on(POWER_MONITOR_EVENTS_CHANNEL, eventsChannelListener);
};

0 comments on commit 8dc9506

Please sign in to comment.