fix: redirect when intro modal first time

This commit is contained in:
Fredrik Burmester
2026-01-09 15:44:10 +01:00
parent 241f8c949a
commit 7514bc2c2c
5 changed files with 20 additions and 31 deletions

View File

@@ -7,18 +7,15 @@ import type {
ParamListBase,
TabNavigationState,
} from "@react-navigation/native";
import { useFocusEffect, withLayoutContext } from "expo-router";
import { useCallback } from "react";
import { withLayoutContext } from "expo-router";
import { useTranslation } from "react-i18next";
import { Platform, View } from "react-native";
import { SystemBars } from "react-native-edge-to-edge";
import { MiniPlayerBar } from "@/components/music/MiniPlayerBar";
import { MusicPlaybackEngine } from "@/components/music/MusicPlaybackEngine";
import { Colors } from "@/constants/Colors";
import { useIntroSheet } from "@/providers/IntroSheetProvider";
import { useSettings } from "@/utils/atoms/settings";
import { eventBus } from "@/utils/eventBus";
import { storage } from "@/utils/mmkv";
const { Navigator } = createNativeBottomTabNavigator();
@@ -32,22 +29,6 @@ export const NativeTabs = withLayoutContext<
export default function TabLayout() {
const { settings } = useSettings();
const { t } = useTranslation();
const { showIntro } = useIntroSheet();
useFocusEffect(
useCallback(() => {
const hasShownIntro = storage.getBoolean("hasShownIntro");
if (!hasShownIntro) {
const timer = setTimeout(() => {
showIntro();
}, 1000);
return () => {
clearTimeout(timer);
};
}
}, [showIntro]),
);
return (
<View style={{ flex: 1 }}>
@@ -61,7 +42,6 @@ export default function TabLayout() {
activeIndicatorColor={"#392c3b"}
scrollEdgeAppearance='default'
>
<NativeTabs.Screen redirect name='index' />
<NativeTabs.Screen
listeners={(_e) => ({
tabPress: (_e) => {

View File

@@ -1,5 +0,0 @@
const Index = () => {
return null;
};
export default Index;