Skip to content

Commit

Permalink
prevent race condition on app start, fixes annoying bug on windows th…
Browse files Browse the repository at this point in the history
…at didn't populate the interface dropdown and rendered app unusable
  • Loading branch information
hobbyquaker committed Jan 28, 2023
1 parent 85894df commit 6603005
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,12 @@ function findInterfaces() {
};
}
});

log.debug('config ready');
ipcRpc.send('config-ready');

initRpcClients();

if (regaPresent) {
rega = new Rega({
host: config.ccuAddress,
Expand Down Expand Up @@ -356,7 +361,7 @@ function initRpcClients() {
}

function setServiceMessage(daemon, channel, datapoint, value) {
console.log('setServiceMessage', daemon, channel, datapoint, value);
log.debug('setServiceMessage', daemon, channel, datapoint, value);
if (value) {
if (!localServiceMessages[daemon]) {
localServiceMessages[daemon] = {};
Expand Down
6 changes: 4 additions & 2 deletions www/js/homematic-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ $('#qr-enable').change(() => {
});


// Entrypoint
getConfig();
ipcRpc.on('config-ready', () => {
// Entrypoint
getConfig();
});

ipcRpc.on('disconnect', () => {
$dialogDisconnect.dialog('open');
Expand Down

0 comments on commit 6603005

Please sign in to comment.