freechat/freechat-client/preload.js
shockrah 102c3b2a10 Electron on Linux hangs when making two successive async calls over the network
Without this calls to /channels/list would break after the first API hit
2021-04-10 17:09:25 -07:00

20 lines
576 B
JavaScript

// Doing this since the projcet this base work is based off uses the same thing
// Kinda looks like something to do with compatibility so I'll keep this here
// until I know if its _actually_ required
window.addEventListener('DOMContentLoaded', () => {
const replaceText = function (selector, text) {
const element = document.getElementById(selector);
if(element) { element.innerText = text; }
}
for(const type of ['chrome', 'node', 'electron']) {
replaceText(`${type}`, process.versions[type]);
}
});
setInterval(() => {
window.setImmediate(() => {})
}, 1000)