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