fix(frontend/location): preserve parent location when using "Create and Add another" (#879)

* fix(frontend/location): preserve parent in "Create and Add another" modal flow

* fix: normalize line endings

* fix: preserve parent location state when modal closed
This commit is contained in:
Ahmosys
2025-07-12 02:08:41 +02:00
committed by GitHub
parent d678c35c57
commit adea83d421

View File

@@ -55,26 +55,17 @@
() => activeDialog.value,
active => {
if (active === "create-location") {
// useTimeoutFn(() => {
// focused.value = true;
// }, 50);
if (locationId.value) {
const found = locations.value.find(l => l.id === locationId.value);
if (found) {
form.parent = found;
form.parent = found || null;
}
}
} else {
// focused.value = false;
}
}
);
function reset() {
form.name = "";
form.description = "";
form.parent = null;
focused.value = false;
loading.value = false;
}
@@ -118,6 +109,7 @@
if (data) {
toast.success(t("components.location.create_modal.toast.create_success"));
}
reset();
if (close) {