Fix: set working state properly

This commit is contained in:
Douglas Barone 2020-12-14 10:42:35 -04:00
parent b03759b64c
commit 6bd6049c02

View File

@ -63,18 +63,18 @@ async function updateDevicesInfo() {
}
}
setTimeout(() => {
working = false
}, DEBOUNCE_TIME_MS)
pubsub.publish(USER_PRESENCE_UPDATED, {
userPresenceUpdated: onlineDevices.length
})
return onlineDevices.length
} catch (e) {
console.log('Error updating DB: ', e)
console.log('Error updating Wi-Fi devices: ', e)
return 0
} finally {
setTimeout(() => {
working = false
}, DEBOUNCE_TIME_MS)
}
}