From 6d507d46ef16cf966f33b51f14787b95f6d5a502 Mon Sep 17 00:00:00 2001 From: GurkiranSingh Date: Sun, 4 Jun 2023 20:37:33 -0400 Subject: [PATCH] chore: Created a computed property for showing Reset Code button Signed-off-by: GurkiranSingh --- packages/ui/client/components/views/ViewEditor.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/ui/client/components/views/ViewEditor.vue b/packages/ui/client/components/views/ViewEditor.vue index ddff37cf2ebc..74dba11d46d4 100644 --- a/packages/ui/client/components/views/ViewEditor.vue +++ b/packages/ui/client/components/views/ViewEditor.vue @@ -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() { @@ -250,7 +252,7 @@ async function onSave(content: string) {