Skip to content

Commit

Permalink
chore: Created a computed property for showing Reset Code button
Browse files Browse the repository at this point in the history
Signed-off-by: GurkiranSingh <[email protected]>
  • Loading branch information
g4rry420 committed Jun 5, 2023
1 parent 98f7c04 commit 6d507d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/ui/client/components/views/ViewEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ const widgets: CodeMirror.LineWidget[] = []
const handles: CodeMirror.LineHandle[] = []
const listeners: [el: HTMLSpanElement, l: EventListener, t: () => void][] = []
const showCodeResetButton = computed(() => testIndex !== null || isDescribeBlock !== null || selectedTest !== null)
const hasBeenEdited = ref(false)
function clearListeners() {
Expand Down Expand Up @@ -250,7 +252,7 @@ async function onSave(content: string) {
<template>
<div>
<IconButton
v-if="testIndex !== null || isDescribeBlock !== null || selectedTest !== null"
v-if="showCodeResetButton"
v-tooltip.bottom="'Reset Code'"
title="Clear search"
icon="i-carbon:reset"
Expand Down

0 comments on commit 6d507d4

Please sign in to comment.