diff options
author | jim <310223+jimmylee@users.noreply.github.com> | 2025-08-25 23:23:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-25 23:23:20 -0700 |
commit | bc8e3ba30b0dd679edf88f0f6038f012b909901f (patch) | |
tree | cbd07bca40c9b6d9f79450e07466b8c0c929b6a1 /src/screens/StarterPack/Wizard/State.tsx | |
parent | e4c5fb7de5b0083ee833acbd039312ce64a83501 (diff) | |
parent | f84a75669157ed5d2dab2a426d9ff5fefb86a9bb (diff) | |
download | voidsky-bc8e3ba30b0dd679edf88f0f6038f012b909901f.tar.zst |
Merge pull request #8806 from internet-development/binaryfiddler/starter-pack-part2
Starter pack dialog implementations
Diffstat (limited to 'src/screens/StarterPack/Wizard/State.tsx')
-rw-r--r-- | src/screens/StarterPack/Wizard/State.tsx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/screens/StarterPack/Wizard/State.tsx b/src/screens/StarterPack/Wizard/State.tsx index 7fae8ca6d..f34218219 100644 --- a/src/screens/StarterPack/Wizard/State.tsx +++ b/src/screens/StarterPack/Wizard/State.tsx @@ -7,7 +7,6 @@ import { import {msg, plural} from '@lingui/macro' import {STARTER_PACK_MAX_SIZE} from '#/lib/constants' -import {useSession} from '#/state/session' import * as Toast from '#/view/com/util/Toast' import * as bsky from '#/types/bsky' @@ -37,6 +36,7 @@ interface State { processing: boolean error?: string transitionDirection: 'Backward' | 'Forward' + targetDid?: string } type TStateContext = [State, (action: Action) => void] @@ -118,15 +118,17 @@ function reducer(state: State, action: Action): State { export function Provider({ starterPack, listItems, + targetProfile, children, }: { starterPack?: AppBskyGraphDefs.StarterPackView listItems?: AppBskyGraphDefs.ListItemView[] + targetProfile: bsky.profile.AnyProfileView children: React.ReactNode }) { - const {currentAccount} = useSession() - const createInitialState = (): State => { + const targetDid = targetProfile?.did + if ( starterPack && bsky.validate(starterPack.record, AppBskyGraphStarterpack.validateRecord) @@ -136,23 +138,22 @@ export function Provider({ currentStep: 'Details', name: starterPack.record.name, description: starterPack.record.description, - profiles: - listItems - ?.map(i => i.subject) - .filter(p => p.did !== currentAccount?.did) ?? [], + profiles: listItems?.map(i => i.subject) ?? [], feeds: starterPack.feeds ?? [], processing: false, transitionDirection: 'Forward', + targetDid, } } return { canNext: true, currentStep: 'Details', - profiles: [], + profiles: [targetProfile], feeds: [], processing: false, transitionDirection: 'Forward', + targetDid, } } |