Browse Source

refactor: remove web bootstrap pending state and set ready status directly upon web_ready signal

master
mortezaei 4 days ago
parent
commit
c09ad72ba7
  1. 4
      src/app/globals.css
  2. 14
      src/app/layout.tsx

4
src/app/globals.css

@ -231,10 +231,6 @@ html:lang(ar) body,
-webkit-overflow-scrolling: touch;
}
html[data-web-bootstrap="pending"] .app-shell {
visibility: hidden;
}
@media (min-width: 640px) {
.app-shell {
width: 375px;

14
src/app/layout.tsx

@ -248,9 +248,6 @@ export default async function RootLayout({
});
var isWebView = !!(window.HabibApp && window.HabibApp.postMessage);
if (isWebView && !configApplied) {
root.dataset.webBootstrap = 'pending';
}
// 4. Queued web_ready Delivery Protocol
//
@ -273,17 +270,8 @@ export default async function RootLayout({
if (!window.HabibApp || !window.HabibApp.postMessage) return false;
window.__habibWebReadySent = true;
if (!configApplied) {
root.dataset.webBootstrap = 'pending';
}
window.HabibApp.postMessage(JSON.stringify({ action: 'web_ready' }));
// Safety: release bootstrap-pending if initial_config never arrives
setTimeout(function() {
if (root.dataset.webBootstrap === 'pending') {
root.dataset.webBootstrap = 'ready';
}
}, 2500);
window.HabibApp.postMessage(JSON.stringify({ action: 'web_ready' }));
return true;
}

Loading…
Cancel
Save