1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Wrong side of fixing crash

This commit is contained in:
xmflsct
2023-01-12 20:17:26 +01:00
parent 50f95900b6
commit 02a90e84f3
2 changed files with 2 additions and 2 deletions

View File

@ -38,7 +38,7 @@ const Root: React.FC<NativeStackScreenProps<TabPublicStackParamList, 'Tab-Public
const previousSegment = getGlobalStorage.string('app.prev_public_segment')
const segments: StorageGlobal['app.prev_public_segment'][] = ['Local', 'LocalPublic', 'Trending']
const [segment, setSegment] = useState<number>(
Math.min(
Math.max(
0,
segments.findIndex(segment => segment === previousSegment)
)