fix: close host center on back
This commit is contained in:
parent
17ef7cb4bb
commit
3b0dd2e800
@ -146,6 +146,6 @@
|
||||
<div class="loading-copy">loading....</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="./script.js?v=20260428-2060" defer></script>
|
||||
<script src="./script.js?v=20260428-2070" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -214,7 +214,7 @@
|
||||
if (window.location.protocol === "file:") return fallbackMessages[normalizedLang];
|
||||
|
||||
try {
|
||||
const response = await fetch(`./locales/${normalizedLang}.json?v=20260428-2060`, { cache: "no-store" });
|
||||
const response = await fetch(`./locales/${normalizedLang}.json?v=20260428-2070`, { cache: "no-store" });
|
||||
if (response.ok) return await response.json();
|
||||
} catch (error) {
|
||||
return fallbackMessages[normalizedLang];
|
||||
@ -461,6 +461,25 @@
|
||||
window.location.replace(buildPageURL("../join-agency/index.html"));
|
||||
}
|
||||
|
||||
function closeHostCenterPage() {
|
||||
try {
|
||||
if (window.app && typeof window.app.closePage === "function") {
|
||||
window.app.closePage();
|
||||
return;
|
||||
}
|
||||
|
||||
if (window.FlutterPageControl && typeof window.FlutterPageControl.postMessage === "function") {
|
||||
window.FlutterPageControl.postMessage("close_page");
|
||||
return;
|
||||
}
|
||||
|
||||
if (window.history.length > 1) window.history.back();
|
||||
} catch (error) {
|
||||
console.error("close host center page failed:", error);
|
||||
if (window.history.length > 1) window.history.back();
|
||||
}
|
||||
}
|
||||
|
||||
function formatCurrentSalary(value) {
|
||||
const numericValue = Number(value);
|
||||
if (Number.isFinite(numericValue)) return numericValue.toFixed(2);
|
||||
@ -878,7 +897,7 @@
|
||||
});
|
||||
|
||||
document.querySelector(".back-button")?.addEventListener("click", () => {
|
||||
if (window.history.length > 1) window.history.back();
|
||||
closeHostCenterPage();
|
||||
});
|
||||
|
||||
document.querySelector(".agency")?.addEventListener("click", () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user