Add “Waiting for content” screen

box-drawing
cpsdqs 7 years ago
parent c68017bd4a
commit 9c4027d2d1
Signed by untrusted user: cpsdqs
GPG Key ID: 3F59586BB7448DD1
  1. 1
      js/term/connection.js
  2. 9
      js/term/index.js

@ -80,6 +80,7 @@ module.exports = class TermConnection extends EventEmitter {
break break
default: default:
this.emit('load')
this.screen.load(evt.data) this.screen.load(evt.data)
if (!this.pageShown) { if (!this.pageShown) {
window.showPage() window.showPage()

@ -25,11 +25,18 @@ module.exports = function (opts) {
}) })
conn.on('connect', () => { conn.on('connect', () => {
clearTimeout(showConnectingTimeout) clearTimeout(showConnectingTimeout)
screen.window.statusScreen = null screen.window.statusScreen = { title: 'Waiting for content', loading: true }
})
conn.on('load', () => {
if (screen.window.statusScreen) screen.window.statusScreen = null
}) })
conn.on('disconnect', () => { conn.on('disconnect', () => {
clearTimeout(showConnectingTimeout) clearTimeout(showConnectingTimeout)
screen.window.statusScreen = { title: 'Disconnected' } screen.window.statusScreen = { title: 'Disconnected' }
screen.screen = []
screen.screenFG = []
screen.screenBG = []
screen.screenAttrs = []
}) })
conn.on('silence', () => { screen.window.statusScreen = { title: 'Waiting for server', loading: true } }) conn.on('silence', () => { screen.window.statusScreen = { title: 'Waiting for server', loading: true } })
// conn.on('ping-fail', () => { screen.window.statusScreen = { title: 'Disconnected' } }) // conn.on('ping-fail', () => { screen.window.statusScreen = { title: 'Disconnected' } })

Loading…
Cancel
Save