properly store last used uri

This commit is contained in:
Hailey
2024-06-16 17:07:15 -07:00
parent 4f6dce4350
commit 19e1c4df09
2 changed files with 6 additions and 2 deletions
+1
View File
@@ -137,6 +137,7 @@ export function StepFinished() {
setUsedStarterPack({
...usedStarterPack,
initialFeed: starterPack?.feeds?.[0].uri ?? 'following',
lastUsedUri: usedStarterPack.uri,
})
}
} catch (e: any) {
+5 -2
View File
@@ -98,7 +98,7 @@ function HomeScreenReady({
const lastPagerReportedIndexRef = React.useRef(selectedIndex)
React.useLayoutEffect(() => {
let initialIndex = selectedIndex
if (usedStarterPack) {
if (usedStarterPack?.initialFeed) {
if (usedStarterPack.initialFeed === 'following') {
initialIndex = allFeeds.findIndex(f => f === 'following')
} else {
@@ -109,7 +109,10 @@ function HomeScreenReady({
if (initialIndex === -1) {
initialIndex = 0
}
setUsedStarterPack(undefined)
setUsedStarterPack({
...usedStarterPack,
initialFeed: undefined,
})
}
// Since the pager is not a controlled component, adjust it imperatively