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

@ -1,6 +1,6 @@
{
"name": "tooot",
"version": "4.8.1",
"version": "4.8.2",
"description": "tooot for Mastodon",
"author": "xmflsct <me@xmflsct.com>",
"license": "GPL-3.0-or-later",

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)
)