From 0db968224b89c89a373a19b0b3484b311b838741 Mon Sep 17 00:00:00 2001 From: aminya Date: Wed, 29 Jul 2020 20:09:58 -0500 Subject: [PATCH] fix: retry initialization --- src/element.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/element.js b/src/element.js index 6b2c6c01..275c0214 100644 --- a/src/element.js +++ b/src/element.js @@ -53,6 +53,8 @@ const X_TERMINAL_OPTIONS = [ 'promptToStartup', ] +let triedInitialization = false + class XTerminalElementImpl extends HTMLElement { async initialize (model) { this.profilesSingleton = XTerminalProfilesSingleton.instance @@ -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 }