fix android notification not working, fix ui bug

This commit is contained in:
Boof2015
2026-06-17 16:28:37 -04:00
parent 9f2ce3bb75
commit 61e7b87d1e
4 changed files with 100 additions and 1 deletions
+5 -1
View File
@@ -1,10 +1,14 @@
import { Tabs } from 'expo-router';
import { TabBar, type TabItem } from '@/components/TabBar';
import { colors } from '@/theme';
export default function TabsLayout() {
return (
<Tabs
screenOptions={{ headerShown: false }}
screenOptions={{
headerShown: false,
sceneStyle: { backgroundColor: colors.bgPrimary },
}}
tabBar={({ state, navigation }) => {
const items: TabItem[] = state.routes.map((route, index) => ({
key: route.key,
+15
View File
@@ -0,0 +1,15 @@
import {
getNotificationClickRedirectPath,
isNotificationClickPath,
} from '@/audio/notificationIntent';
type RedirectSystemPathEvent = {
path: string;
initial: boolean;
};
export async function redirectSystemPath({ path }: RedirectSystemPathEvent): Promise<string> {
if (!isNotificationClickPath(path)) return path;
return getNotificationClickRedirectPath();
}
+34
View File
@@ -0,0 +1,34 @@
import { useEffect } from 'react';
import { StyleSheet, View } from 'react-native';
import { useRouter } from 'expo-router';
import { getNotificationClickRedirectPath } from '@/audio/notificationIntent';
import { colors } from '@/theme';
export default function NotificationClickRoute() {
const router = useRouter();
useEffect(() => {
let cancelled = false;
getNotificationClickRedirectPath()
.then((href) => {
if (!cancelled) router.replace(href);
})
.catch(() => {
if (!cancelled) router.replace('/');
});
return () => {
cancelled = true;
};
}, [router]);
return <View style={styles.root} />;
}
const styles = StyleSheet.create({
root: {
flex: 1,
backgroundColor: colors.bgPrimary,
},
});