fix: false not undefined in result (#2620)

This commit is contained in:
HugoCasa
2023-11-13 19:14:30 +01:00
committed by GitHub
parent ae3f0ee5f4
commit f185eba49c
2 changed files with 5 additions and 4 deletions
@@ -69,7 +69,7 @@
return 'json'
}
if (result) {
if (result !== undefined) {
try {
let keys = Object.keys(result)
@@ -153,8 +153,9 @@
>
<slot name="copilot-fix" />
</div>
{/if}{#if typeof result == 'object' && Object.keys(result).length > 0}<div
class="top-0 mb-2 w-full min-w-[400px] text-sm relative"
{/if}
{#if typeof result == 'object' && Object.keys(result).length > 0}
<div class="top-0 mb-2 w-full min-w-[400px] text-sm relative"
>{#if !disableExpand}
<div class="text-tertiary text-xs absolute top-5.5 right-0 inline-flex gap-2 z-10">
<button on:click={() => copyToClipboard(toJsonStr(result))}
@@ -19,7 +19,7 @@
>
<div class="bg-surface {col ? '' : 'max-h-80'} h-full p-1 overflow-auto relative">
<span class="text-tertiary">Result</span>
{#if result}
{#if result !== undefined}
<DisplayResult {workspaceId} {jobId} {filename} {result} />
{:else if loading}
<Loader2 class="animate-spin" />