diff --git a/src/app/questions-list/questions-list-client.tsx b/src/app/questions-list/questions-list-client.tsx index 2cec762..ffb38ea 100644 --- a/src/app/questions-list/questions-list-client.tsx +++ b/src/app/questions-list/questions-list-client.tsx @@ -63,15 +63,14 @@ export default function QuestionsListClient() { // entries. Flutter calls __habibHandleHardwareBack() and we return false // (meaning "I didn't handle it — you should close"). useHardwareBackHandler(() => { + if (isOptionalInfoSheetOpen) { + setIsOptionalInfoSheetOpen(false); + return true; // Handled: closed the tips sheet + } if (activeSectionSlug) { handleCloseSection(); return true; // Handled: closed the section sheet, do not close WebView } - if (typeof window !== "undefined" && (window as any).HabibApp?.postMessage) { - (window as any).HabibApp.postMessage( - JSON.stringify({ action: "close_service" }), - ); - } return false; // Tell Flutter to close the WebView screen }); const { dictionary: t, locale } = useI18n(); diff --git a/src/components/Componentes/information-sheet.tsx b/src/components/Componentes/information-sheet.tsx index a435feb..53b72d8 100644 --- a/src/components/Componentes/information-sheet.tsx +++ b/src/components/Componentes/information-sheet.tsx @@ -172,7 +172,10 @@ export function InformationSheet({ }, EXIT_ANIMATION_MS); }, [isClosing, onClose]); - useHardwareBackHandler(closeSheet, isVisible && !isClosing); + useHardwareBackHandler(() => { + closeSheet(); + return true; + }, isVisible && !isClosing); const controls = { close: closeSheet }; const resolvedTitle = typeof title === "function" ? title(controls) : title;