Skip to content

Commit

Permalink
fix: retry initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jul 30, 2020
1 parent d91c0a4 commit 0db9682
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ const X_TERMINAL_OPTIONS = [
'promptToStartup',
]

let triedInitialization = false

class XTerminalElementImpl extends HTMLElement {
async initialize (model) {
this.profilesSingleton = XTerminalProfilesSingleton.instance
Expand Down Expand Up @@ -132,8 +134,16 @@ class XTerminalElementImpl extends HTMLElement {
)
resolveInit()
} catch (ex) {
rejectInit(ex)
throw ex
// TODO #57
triedInitialization = true
if (!triedInitialization) {
try {
this.initialize(model)
} catch (ex2) {
rejectInit(ex2)
throw ex2
}
}
}
this.isInitialized = true
}
Expand Down

0 comments on commit 0db9682

Please sign in to comment.