Skip to content

Commit 6659564

Browse files
committed
Handle rollup color absence
1 parent f955f35 commit 6659564

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

components/modules/rollup/RollupOverview.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,13 @@ const handleCSVDownload = async (value) => {
320320
<Flex gap="4" :class="$style.content">
321321
<Flex direction="column" :class="$style.data">
322322
<Flex direction="column" gap="24" :class="$style.main">
323-
<div
324-
:style="{ background: `linear-gradient(90deg, ${rollupColorAlpha}, ${rollupColor}, ${rollupColorAlpha})` }"
325-
:class="$style.line"
326-
/>
327-
<div :style="{ background: `linear-gradient(${rollupColor}, ${rollupColorAlpha})` }" :class="$style.bg" />
323+
<template v-if="rollupColor && rollupColorAlpha">
324+
<div
325+
:style="{ background: `linear-gradient(90deg, ${rollupColorAlpha}, ${rollupColor}, ${rollupColorAlpha})` }"
326+
:class="$style.line"
327+
/>
328+
<div :style="{ background: `linear-gradient(${rollupColor}, ${rollupColorAlpha})` }" :class="$style.bg" />
329+
</template>
328330
329331
<Flex direction="column" gap="20" :class="$style.key_value">
330332
<Flex align="center" justify="between" gap="24" wide>

services/utils/general.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ export function sortArrayOfObjects(arr, path, asc = true) {
190190
}
191191

192192
export function hexToRgba(hex, alpha = 255) {
193+
if (!hex) return ""
194+
193195
let h = hex.replace(/^#/, "")
194196

195197
if (h.length === 3) {

0 commit comments

Comments
 (0)