From a0a26afd90313a3aba167c82b8bcd96f64a082e5 Mon Sep 17 00:00:00 2001 From: liyasthomas Date: Tue, 1 Mar 2022 20:21:25 +0530 Subject: [PATCH] fix: codemirror instance disappearing often --- packages/hoppscotch-app/helpers/editor/codemirror.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/hoppscotch-app/helpers/editor/codemirror.ts b/packages/hoppscotch-app/helpers/editor/codemirror.ts index caac52e61..772774a02 100644 --- a/packages/hoppscotch-app/helpers/editor/codemirror.ts +++ b/packages/hoppscotch-app/helpers/editor/codemirror.ts @@ -259,7 +259,8 @@ export function useCodemirror( watch(el, () => { if (el.value) { - if (!view.value) initView(el.value) + if (view.value) view.value.destroy() + initView(el.value) } else { view.value?.destroy() view.value = undefined