From d287245cd9c87d21c137a344afa295768de61a63 Mon Sep 17 00:00:00 2001 From: Flawid DSouza Date: Fri, 24 Jan 2025 11:38:20 +0530 Subject: [PATCH] feat(ui): Environment modal > prevent closing editor if invalid json (resolves #305) --- packages/ui/src/components/modals/EnvironmentModal.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/ui/src/components/modals/EnvironmentModal.vue b/packages/ui/src/components/modals/EnvironmentModal.vue index b841c75e..4a9b1c76 100644 --- a/packages/ui/src/components/modals/EnvironmentModal.vue +++ b/packages/ui/src/components/modals/EnvironmentModal.vue @@ -114,6 +114,11 @@ export default { return this.showModal }, set(value) { + if (this.parseError) { + this.$toast.error('Invalid JSON. Please fix the error before closing the editor.') + return + } + this.$emit('update:showModal', value) } },