mirror of https://github.com/embarklabs/embark.git
webserver: Emit websocket outputError and show error on the landing page.
Whenever outputError is emitted by Ember, display error message on the landing page and stop the page from refreshing every four seconds. Refs: https://github.com/embark-framework/embark/issues/946
This commit is contained in:
parent
79d8dc8dca
commit
bc68687994
|
@ -50,6 +50,11 @@ class Server {
|
|||
ws.send('outputDone');
|
||||
});
|
||||
});
|
||||
self.events.on('outputError', () => {
|
||||
if (ws.readyState === WEB_SOCKET_STATE_OPEN) {
|
||||
return ws.send('outputError');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
async.waterfall([
|
||||
|
|
|
@ -30,7 +30,10 @@
|
|||
ws.addEventListener('message', (evt) => {
|
||||
if(evt.data === 'outputDone') {
|
||||
location.reload(true);
|
||||
} else if(evt.data === 'outputError') {
|
||||
document.getElementsByClassName("loading-msg")[0].innerHTML = "Error building dapp, please check console";
|
||||
window.stop()
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue