diff --git a/apps/desktop/src/components/config/ConfigPassphraseDialog.vue b/apps/desktop/src/components/config/ConfigPassphraseDialog.vue index 88d99e237..10445254b 100644 --- a/apps/desktop/src/components/config/ConfigPassphraseDialog.vue +++ b/apps/desktop/src/components/config/ConfigPassphraseDialog.vue @@ -28,13 +28,17 @@ const passphrase = ref(""); const passphraseConfirm = ref(""); const error = ref(""); -watch(dialogOpen, (open) => { - if (open) { - passphrase.value = ""; - passphraseConfirm.value = ""; - error.value = ""; - } -}); +watch( + dialogOpen, + (open) => { + if (open) { + passphrase.value = ""; + passphraseConfirm.value = ""; + error.value = ""; + } + }, + { immediate: true }, +); function confirm() { if (!passphrase.value) { diff --git a/apps/desktop/src/components/connection/ConnectionDialog.vue b/apps/desktop/src/components/connection/ConnectionDialog.vue index 4f755a578..51138634a 100644 --- a/apps/desktop/src/components/connection/ConnectionDialog.vue +++ b/apps/desktop/src/components/connection/ConnectionDialog.vue @@ -667,17 +667,21 @@ function resetForm() { resetTestState(); } -watch(open, (value) => { - if (!value) { - resetForm(); - return; - } - if (!props.editConfig) { - resetForm(); - } - void loadJdbcDrivers(); - void loadAgentDrivers(); -}); +watch( + open, + (value) => { + if (!value) { + resetForm(); + return; + } + if (!props.editConfig) { + resetForm(); + } + void loadJdbcDrivers(); + void loadAgentDrivers(); + }, + { immediate: true }, +); watch(canUseSsh, (value) => { if (!value && configTab.value === "ssh") { diff --git a/apps/desktop/src/components/diagram/SchemaDiagramDialog.vue b/apps/desktop/src/components/diagram/SchemaDiagramDialog.vue index f4343ba67..a7ff39429 100644 --- a/apps/desktop/src/components/diagram/SchemaDiagramDialog.vue +++ b/apps/desktop/src/components/diagram/SchemaDiagramDialog.vue @@ -661,9 +661,13 @@ function stopDrag() { window.removeEventListener("mouseup", stopDrag); } -watch(open, (value) => { - if (value) void initialize(); -}); +watch( + open, + (value) => { + if (value) void initialize(); + }, + { immediate: true }, +); watch( () => visibleTables.value.map((table) => table.name).join("\n"), diff --git a/apps/desktop/src/components/diff/DataCompareDialog.vue b/apps/desktop/src/components/diff/DataCompareDialog.vue index 57f203517..28718749c 100644 --- a/apps/desktop/src/components/diff/DataCompareDialog.vue +++ b/apps/desktop/src/components/diff/DataCompareDialog.vue @@ -412,21 +412,25 @@ watch(sourceTable, (table, previous) => { } }); watch(targetTable, () => clearResult()); -watch(open, async (value) => { - if (!value) return; - result.value = null; - syncSql.value = ""; - if (props.prefillConnectionId) { - sourceConnectionId.value = props.prefillConnectionId; - await loadDatabases(props.prefillConnectionId, "source"); - if (props.prefillDatabase) sourceDatabase.value = props.prefillDatabase; - if (props.prefillDatabase) await loadSchemas("source", props.prefillSchema); - if (props.prefillTable) { - await loadTables("source"); - if (sourceTables.value.includes(props.prefillTable)) sourceTable.value = props.prefillTable; +watch( + open, + async (value) => { + if (!value) return; + result.value = null; + syncSql.value = ""; + if (props.prefillConnectionId) { + sourceConnectionId.value = props.prefillConnectionId; + await loadDatabases(props.prefillConnectionId, "source"); + if (props.prefillDatabase) sourceDatabase.value = props.prefillDatabase; + if (props.prefillDatabase) await loadSchemas("source", props.prefillSchema); + if (props.prefillTable) { + await loadTables("source"); + if (sourceTables.value.includes(props.prefillTable)) sourceTable.value = props.prefillTable; + } } - } -}); + }, + { immediate: true }, +);