Skip to content

Commit 8a2e61f

Browse files
committed
fix:domains (#4111)
- resotre watch deep
1 parent 29d89e4 commit 8a2e61f

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

packages/playground/src/components/node_selector/TfDomainName.vue

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ import { type InputValidatorService, useInputRef } from "@/hooks/input_validator
110110
111111
import { useAsync, usePagination } from "../../hooks";
112112
import { useForm, useFormRef, ValidatorStatus } from "../../hooks/form_validator";
113+
import { useWatchDeep } from "../../hooks/useWatchDeep";
113114
import { useGrid } from "../../stores";
114115
import type { DomainInfo, NetworkFeatures, SelectionDetailsFilters } from "../../types/nodeSelector";
115116
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -181,18 +182,19 @@ export default {
181182
return loadDomains();
182183
};
183184
184-
watch(
185-
[() => props.farm?.farmId, () => gridStore.client?.twinId, () => props.interfaces],
186-
() => {
187-
reloadDomains();
185+
useWatchDeep(
186+
() => ({
187+
farmId: props.farm?.farmId,
188+
twinId: gridStore.client?.twinId,
189+
interfaces: props.interfaces,
190+
}),
191+
(newVal, oldVal) => {
192+
if (JSON.stringify(oldVal) !== JSON.stringify(newVal)) {
193+
reloadDomains();
194+
}
188195
},
189-
{ deep: true },
190196
);
191197
192-
onMounted(() => {
193-
loadDomains();
194-
});
195-
196198
const customDomain = ref("");
197199
const domainFormRef = useFormRef();
198200

0 commit comments

Comments
 (0)