Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: selected engine change (#12727)

ecmadao6e5d0e4d6505
diff --git a/frontend/src/components/SQLReview/components/SQLReviewTabsByEngine.vue b/frontend/src/components/SQLReview/components/SQLReviewTabsByEngine.vue
index c7b2862cf0..396aeb6ab3 100644
--- a/frontend/src/components/SQLReview/components/SQLReviewTabsByEngine.vue
+++ b/frontend/src/components/SQLReview/components/SQLReviewTabsByEngine.vue
@@ -29,7 +29,7 @@
<script setup lang="ts">
import { NTabs, NTabPane } from "naive-ui";
-import { ref, watchEffect } from "vue";
+import { ref, watch } from "vue";
import type { RuleTemplateV2 } from "@/types";
import { Engine } from "@/types/proto/v1/common";
@@ -39,8 +39,9 @@ const props = defineProps<{
ruleMapByEngine: Map<Engine, Map<string, RuleTemplateV2>>;
}>();
-watchEffect(() => {
- selectedEngine.value =
- [...props.ruleMapByEngine.keys()][0] ?? Engine.UNRECOGNIZED;
-});
+watch(
+ () => [...props.ruleMapByEngine.keys()][0] ?? Engine.UNRECOGNIZED,
+ (engine) => (selectedEngine.value = engine),
+ { immediate: true }
+);
</script>