From f6bfb93c70e0b13ca47562489ca35d2c48ecb272 Mon Sep 17 00:00:00 2001 From: Xavier Marin Date: Thu, 24 Aug 2023 09:27:23 +0200 Subject: [PATCH] Fix no bootstrap when @endpoint is used --- .../warp-view-editor/warp-view-editor.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/warpview-editor-ng/src/lib/elements/warp-view-editor/warp-view-editor.component.ts b/projects/warpview-editor-ng/src/lib/elements/warp-view-editor/warp-view-editor.component.ts index 26e5668..4266dc4 100755 --- a/projects/warpview-editor-ng/src/lib/elements/warp-view-editor/warp-view-editor.component.ts +++ b/projects/warpview-editor-ng/src/lib/elements/warp-view-editor/warp-view-editor.component.ts @@ -607,13 +607,13 @@ FLOWS this.loading = true; // parse comments to look for inline url or preview modifiers const specialHeaders = WarpScriptParser.extractSpecialComments(code); - const previewType = specialHeaders.displayPreviewOpt || 'none'; + const previewType = specialHeaders.displayPreviewOpt ?? 'none'; if (previewType === 'I') { this.selectedResultTab = 2; // select image tab. } else if (this.selectedResultTab === 2) { this.selectedResultTab = 0; // on next execution, select results tab. } - const executionUrl = specialHeaders.endpoint || this.url; + const executionUrl = specialHeaders.endpoint ?? this.url; this.LOG.debug(['execute'], 'specialHeaders', this.innerConfig.addLocalHeader); // Get Warp10 version // @ts-ignore @@ -627,7 +627,7 @@ FLOWS if (!!session) { headers['X-Warp10-WarpScriptSession'] = session; } - this.request = this.http.post>(executionUrl, (bootstrap ? bootstrap + ' ' : '') + code, { + this.request = this.http.post>(executionUrl, (!specialHeaders.endpoint && bootstrap ? bootstrap + ' ' : '') + code, { observe: 'response', // @ts-ignore responseType: 'text', @@ -637,7 +637,7 @@ FLOWS .subscribe((res: HttpResponse) => { if (!!res) { this.LOG.debug(['execute'], 'response', res.body); - this.warpViewEditorWarpscriptResult.emit(res.body || (res as any)); + this.warpViewEditorWarpscriptResult.emit(res.body ?? (res as any)); BubblingEvents.emitBubblingEvent(this.el, 'warpViewEditorWarpscriptResult', res.body || (res as any)); if (!!res.headers) { this.sendStatus({