Await promise

This commit is contained in:
garrettmills 2020-05-25 17:27:29 -05:00
parent af01cd0f5d
commit a1a70e0548
No known key found for this signature in database
GPG Key ID: 6ACD58D6ADACFC6E

View File

@ -27,7 +27,7 @@ class MessageService {
this.listener = setInterval(() => this._listener_tick(), this.listener_interval) this.listener = setInterval(() => this._listener_tick(), this.listener_interval)
window.addEventListener('beforeunload', () => this.stop_listener()) window.addEventListener('beforeunload', () => this.stop_listener())
try { try {
this._listener_tick() await this._listener_tick()
} catch (e) { } catch (e) {
this.stop_listener() this.stop_listener()
} }