Skip to content

Commit

Permalink
fix(*): add question marks before tostring [KHCP-12065] (#2200)
Browse files Browse the repository at this point in the history
  • Loading branch information
portikM authored and adamdehaven committed Jun 3, 2024
1 parent 36e7030 commit 20566fd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/KCodeBlock/KCodeBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ const matchingLineNumbers = ref<number[]>([])
const currentLineIndex = ref<null | number>(null)
const totalLines = computed((): number[] => Array.from({ length: props.code?.split('\n').length }, (_, index) => index + 1))
const maxLineNumberWidth = computed((): string => totalLines.value[totalLines.value.length - 1].toString().length + 'ch')
const maxLineNumberWidth = computed((): string => totalLines.value[totalLines.value.length - 1]?.toString().length + 'ch')
const linePrefix = computed((): string => props.id.toLowerCase().replace(/\s+/g, '-'))
const isProcessing = computed((): boolean => props.processing || isProcessingInternally.value)
const isShowingFilteredCode = computed((): boolean => isFilterMode.value && filteredCode.value !== '')
Expand Down
4 changes: 2 additions & 2 deletions src/components/KInput/KInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ const charLimitExceededErrorMessage = computed((): string => {
}
return modelValueChanged.value
? `${currValue.value.toString().length} / ${props.characterLimit}`
: `${props.modelValue.toString().length} / ${props.characterLimit}`
? `${currValue.value?.toString().length} / ${props.characterLimit}`
: `${props.modelValue?.toString().length} / ${props.characterLimit}`
})
const helpText = computed((): string => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/KTextArea/KTextArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ const helpText = computed((): string => {
// if character limit exceeded, return that error message
if (charLimitExceeded.value) {
return `${currValue.value.toString().length} / ${characterLimit}`
return `${currValue.value?.toString().length} / ${characterLimit}`
}
// otherwise return the help text
Expand Down

0 comments on commit 20566fd

Please sign in to comment.