diff --git a/miniapp/assets/app.js b/miniapp/assets/app.js index 7db679d..9d33fd3 100644 --- a/miniapp/assets/app.js +++ b/miniapp/assets/app.js @@ -1199,8 +1199,9 @@ async function renderInboxDetail(measurementId) { `); header.querySelector(".podbor-back").addEventListener("click", () => { + // Возврат в главное меню без перезагрузки (иначе сплэш мигает) location.hash = ""; - if (!location.hash) location.reload(); + routeByHash(); }); app.appendChild(header); diff --git a/miniapp/assets/assembly.js b/miniapp/assets/assembly.js index 743c281..90ad221 100644 --- a/miniapp/assets/assembly.js +++ b/miniapp/assets/assembly.js @@ -226,7 +226,7 @@ const Assembly = (function () { btn.style.display = "none"; result.querySelector("#toHome")?.addEventListener("click", () => { location.hash = ""; - location.reload(); + if (typeof routeByHash === "function") routeByHash(); }); result.querySelector("#toDetail")?.addEventListener("click", () => { location.hash = `#/assembly/${data.id}`; diff --git a/miniapp/assets/clients.js b/miniapp/assets/clients.js index a745b11..44a3ed6 100644 --- a/miniapp/assets/clients.js +++ b/miniapp/assets/clients.js @@ -1804,8 +1804,9 @@ const Clients = (function () { } else if (backHref) { location.hash = backHref; } else { + // Возврат в главное меню — без перезагрузки страницы (иначе сплэш мигает) location.hash = ""; - location.reload(); + if (typeof routeByHash === "function") routeByHash(); } }); return h; diff --git a/miniapp/assets/measurements.js b/miniapp/assets/measurements.js index af7ea17..7b05563 100644 --- a/miniapp/assets/measurements.js +++ b/miniapp/assets/measurements.js @@ -146,7 +146,7 @@ const Measurements = (function () { `); h.querySelector(".podbor-back").addEventListener("click", () => { location.hash = ""; - location.reload(); + if (typeof routeByHash === "function") routeByHash(); }); h.querySelector("#openChecklist").addEventListener("click", () => { location.hash = "#/measure/checklist"; @@ -969,7 +969,7 @@ const Measurements = (function () { node.querySelector("#newOne")?.addEventListener("click", () => mount(root)); node.querySelector("#toHome")?.addEventListener("click", () => { location.hash = ""; - location.reload(); + if (typeof routeByHash === "function") routeByHash(); }); } catch (e) { result.innerHTML = `
Сеть: ${e.message}
`; diff --git a/miniapp/assets/podbor.js b/miniapp/assets/podbor.js index a645ea3..a2335a4 100644 --- a/miniapp/assets/podbor.js +++ b/miniapp/assets/podbor.js @@ -108,9 +108,9 @@ const Podbor = (function () { h.querySelector(".podbor-back").addEventListener("click", () => { const idx = STEPS.indexOf(currentStep); if (idx <= 0) { - // Выход из подбора в главный экран кабинета + // Выход из подбора в главный экран кабинета — без перезагрузки (иначе сплэш мигает) location.hash = ""; - location.reload(); + if (typeof routeByHash === "function") routeByHash(); } else { go(STEPS[idx - 1]); } diff --git a/miniapp/assets/request.js b/miniapp/assets/request.js index 335c808..a24882e 100644 --- a/miniapp/assets/request.js +++ b/miniapp/assets/request.js @@ -208,7 +208,7 @@ const MeasurementRequest = (function () { form.querySelector("#newOne")?.addEventListener("click", () => mount(root)); form.querySelector("#toHome")?.addEventListener("click", () => { location.hash = ""; - location.reload(); + if (typeof routeByHash === "function") routeByHash(); }); } catch (e) { result.innerHTML = `
Сеть: ${e.message}
`; @@ -227,8 +227,10 @@ const MeasurementRequest = (function () { `); h.querySelector(".podbor-back").addEventListener("click", () => { if (backHref) location.hash = backHref; - else location.hash = ""; - if (!location.hash) location.reload(); + else { + location.hash = ""; + if (typeof routeByHash === "function") routeByHash(); + } }); return h; } diff --git a/miniapp/index.html b/miniapp/index.html index 15690d2..7ec980f 100644 --- a/miniapp/index.html +++ b/miniapp/index.html @@ -38,13 +38,13 @@ - - + + - - - + + + - +