fix: handle null

This commit is contained in:
puriphatt 2024-11-13 16:40:54 +07:00
parent fe83de88de
commit 00157a420b

View file

@ -283,7 +283,7 @@ watch(
if (ret) {
currWorkflow.value = ret;
tempStep.value =
ret.step.length > 0
ret.step?.length > 0
? ret.step.map((s) => ({
name: s.name,
attributes: s.attributes,
@ -329,7 +329,7 @@ watch(
</template>
<div
v-if="tempStep.length === 0"
v-if="tempStep?.length === 0"
class="row surface-1 rounded bordered items-center justify-center col"
:class="{
'q-ma-lg': $q.screen.gt.sm,
@ -378,8 +378,8 @@ watch(
<div class="full-width flex items-center">
<q-icon
v-if="
tempStep[stepIndex].attributes.properties.length ===
propertiesOption.length
tempStep[stepIndex].attributes.properties?.length ===
propertiesOption?.length
"
name="mdi-checkbox-marked"
size="xs"
@ -432,7 +432,7 @@ watch(
</span>
<div
v-if="tempStep[stepIndex].attributes.properties.length === 0"
v-if="tempStep[stepIndex].attributes?.properties?.length === 0"
class="row surface-1 rounded bordered items-center justify-center col"
:class="{
'q-ma-lg': $q.screen.gt.sm,
@ -442,7 +442,7 @@ watch(
<NoData useField />
</div>
<div
v-if="tempStep[stepIndex].attributes.properties.length > 0"
v-if="tempStep[stepIndex].attributes?.properties?.length > 0"
class="q-py-sm"
:class="{
'q-px-lg': $q.screen.gt.sm,
@ -474,7 +474,7 @@ watch(
flat
round
:size="$q.screen.xs ? 'xs' : ''"
:disable="propIndex === tempStep.length - 1"
:disable="propIndex === tempStep?.length - 1"
style="color: hsl(var(--text-mute-2))"
@click="moveItemDown(tempStep, propIndex)"
/>