From fdcd607033e56fdd246584ebfad32af4c44467e3 Mon Sep 17 00:00:00 2001 From: ghostcoder42 Date: Fri, 4 Sep 2026 18:20:08 +0800 Subject: [PATCH] fix: mount global FlashMessage so showMessage toasts render MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit showMessage() was called from three places (update check results, download notifications, domain switch) but no was ever mounted, so every toast was silently dropped — the manual update check looked completely dead when already on the latest version. Mount it once in the root layout inside SafeAreaProvider, top-positioned with the status-bar inset so it clears the notch. --- src/app/_layout.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/app/_layout.tsx b/src/app/_layout.tsx index ecce622..68f9cef 100644 --- a/src/app/_layout.tsx +++ b/src/app/_layout.tsx @@ -15,7 +15,8 @@ import * as SplashScreen from 'expo-splash-screen'; import { StatusBar } from 'expo-status-bar'; import { useEffect } from 'react'; import { Appearance, Pressable, View, useColorScheme as useRNColorScheme } from 'react-native'; -import { SafeAreaProvider } from 'react-native-safe-area-context'; +import FlashMessage from 'react-native-flash-message'; +import { SafeAreaProvider, useSafeAreaInsets } from 'react-native-safe-area-context'; SplashScreen.preventAutoHideAsync().catch(() => {}); @@ -38,6 +39,17 @@ function BackHeader({ onBack }: { onBack: () => void }) { ); } +/** + * Global mount for `showMessage()` (update checks, download notifications, + * domain switch). Without a in the tree those toasts are + * silently dropped. Must live inside SafeAreaProvider; `statusBarHeight` + * keeps top-positioned messages below the status bar. + */ +function GlobalFlashMessage() { + const insets = useSafeAreaInsets(); + return ; +} + export default function RootLayout() { const [theme] = useThemeConfig(); const systemScheme = useRNColorScheme(); @@ -111,6 +123,7 @@ export default function RootLayout() { + );