mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-24 06:28:34 +01:00
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:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user