Skip to content

Commit

Permalink
move ternary operator to data side to fix concatenation error
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyBlaise99 committed Jan 21, 2024
1 parent cdf2689 commit 205c1a5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions frontend/src/components/c-segment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
div(v-if="isOpen", v-hljs="path")
.code(
v-for="(line, index) in segment.lines", v-bind:key="index",
v-bind:style="{ 'background-color': `${authorColors[segment.knownAuthor]}" +
"${segment.isFullCredit ? fullCreditTransparencyValue : partialCreditTransparencyValue}` }"
v-bind:style="{ 'background-color': `${authorColors[segment.knownAuthor]}${transparencyValue}` }"
)
.line-number {{ `${segment.lineNumbers[index]}\n` }}
.line-content {{ `${line}\n` }}
Expand Down Expand Up @@ -54,8 +53,7 @@ export default defineComponent({
return {
isOpen: (this.segment.knownAuthor !== null) || this.segment.lines.length < 5 as boolean,
canOpen: (this.segment.knownAuthor === null) && this.segment.lines.length > 4 as boolean,
fullCreditTransparencyValue: '75' as string,
partialCreditTransparencyValue: '30' as string,
transparencyValue: (this.segment.isFullCredit ? '75' : '30') as string,
};
},
computed: {
Expand Down

0 comments on commit 205c1a5

Please sign in to comment.