feat: envinput revalidates with environment changes

This commit is contained in:
Andrew Bastin
2021-08-01 23:05:15 -04:00
parent d9d61b5b1d
commit 6acb9be48c

View File

@@ -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()
},