Skip to content

Commit

Permalink
Merge branch 'tweak_dom_remove'
Browse files Browse the repository at this point in the history
  • Loading branch information
tamuratak committed Nov 17, 2024
2 parents 0a446f3 + 19e0f81 commit f6ce7ea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion viewer/components/extensionconnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export class ExtensionConnection {
}

private notifyDisconnected() {
if (this.disconnectedNotificationDom) {
return
}
const dom = document.createElement('div')
dom.id = 'notify-disconnected'
dom.textContent = 'Disconnected from LaTeX Toybox. Trying to reconnect...'
Expand All @@ -27,10 +30,11 @@ export class ExtensionConnection {
}

private async notifyReconnected() {
this.disconnectedNotificationDom?.remove()
this.disconnectedNotificationDom = undefined
const dom = document.createElement('div')
dom.id = 'notify-reconnected'
dom.textContent = 'Reconnected to LaTeX Toybox. Happy TeXing!'
this.disconnectedNotificationDom?.remove()
document.body.appendChild(dom)
await sleep(3000)
dom.classList.add('hide')
Expand Down

0 comments on commit f6ce7ea

Please sign in to comment.