From 6acb9be48cd6d25740ef0eec74d8fa7c9eb585db Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Sun, 1 Aug 2021 23:05:15 -0400 Subject: [PATCH] feat: envinput revalidates with environment changes --- components/smart/EnvInput.vue | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/components/smart/EnvInput.vue b/components/smart/EnvInput.vue index ea76c435e..9edbc7516 100644 --- a/components/smart/EnvInput.vue +++ b/components/smart/EnvInput.vue @@ -26,7 +26,11 @@ import IntervalTree from "node-interval-tree" import debounce from "lodash/debounce" import isUndefined from "lodash/isUndefined" import { tippy } from "vue-tippy" -import { getCurrentEnvironment } from "~/newstore/environments" +import { + currentEnvironment$, + getCurrentEnvironment, +} from "~/newstore/environments" +import { useReadonlyStream } from "~/helpers/utils/composables" const tagsToReplace = { "&": "&", @@ -49,7 +53,16 @@ export default defineComponent({ default: "", }, }, + setup() { + const currentEnvironment = useReadonlyStream( + currentEnvironment$, + getCurrentEnvironment() + ) + return { + currentEnvironment, + } + }, data() { return { internalValue: "", @@ -70,6 +83,9 @@ export default defineComponent({ }, watch: { + currentEnvironment() { + this.processHighlights() + }, highlightStyle() { this.processHighlights() },