fix: editor widget resolving when creating new tab

An already opened editor widget can resolve without waiting.

Closes #1718

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
Akos Kitta 2022-11-28 19:09:50 +01:00 committed by Akos Kitta
parent fe3fbb189c
commit 8778d70ad7

View File

@ -184,7 +184,7 @@ export class OpenSketchFiles extends SketchContribution {
// The editor is expected to be attached to the shell and visible in the UI.
// The deferred promise does not have to wait for the `editorManager#onCreated` event.
// It can resolve earlier.
if (!widget) {
if (widget) {
deferred.resolve(editorWidget);
}
});