From 5dee6e3608d90f933b654f12944ceb631b8958ef Mon Sep 17 00:00:00 2001 From: Yaacov Date: Fri, 16 Aug 2024 20:26:27 +0200 Subject: [PATCH] Fix eslint finally (and possibly importing JSON content?) --- confiture-web-app/src/components/ui/Tiptap.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/confiture-web-app/src/components/ui/Tiptap.vue b/confiture-web-app/src/components/ui/Tiptap.vue index ed15a1d5..63293483 100644 --- a/confiture-web-app/src/components/ui/Tiptap.vue +++ b/confiture-web-app/src/components/ui/Tiptap.vue @@ -29,12 +29,14 @@ const props = defineProps(["content"]); const emit = defineEmits(["update:content"]); function getContent() { - let jsonContent = props.content; + let jsonContent; try { jsonContent = JSON.parse(props.content); - } finally { - return jsonContent; + } catch { + jsonContent = props.content; } + + return jsonContent; } const editor = useEditor({