Skip to content

Commit

Permalink
refactor(recordlistitem): adding id as a route param to the Credentia…
Browse files Browse the repository at this point in the history
…lShare flow
  • Loading branch information
thwalln committed Nov 7, 2022
1 parent 351030d commit fc97675
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/hooks/interactions/useAuthSubmit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useCompleteInteraction } from './useCompleteInteraction'
import { useAgent } from '../sdk'
import { ScreenNames } from '~/types/screens'
import { useRedirect } from '../navigation'
import History from '~/screens/LoggedIn/History'

const useAuthSubmit = () => {
const getInteraction = useInteraction()
Expand Down
9 changes: 6 additions & 3 deletions src/hooks/interactions/useCredentialShareSubmit.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { useCredentialShareFlow } from './useCredentialShareFlow'
import { useCompleteInteraction } from './useCompleteInteraction'
import { ScreenNames } from '~/types/screens'
import { useInteraction } from './handlers'
import { useRedirect } from '../navigation'

const useCredentialShareSubmit = () => {
const getInteraction = useInteraction()
const { assembleShareResponseToken } = useCredentialShareFlow()
const redirect = useRedirect()
const { completeInteraction } = useCompleteInteraction(async () => {
const interaction = await getInteraction()
await assembleShareResponseToken()

return {
screenToNavigate: ScreenNames.History,
}
return redirect(ScreenNames.History, { id: interaction.id })
})

return completeInteraction
Expand Down
2 changes: 0 additions & 2 deletions src/screens/LoggedIn/History/RecordItemsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,12 @@ const RecordItemsList: React.FC<IRecordItemsListProps> = ({

useInteractionCreate((interaction) => {
if (shouldUpdateRecords(interaction, flows)) {
setFocusedItem(interaction.id)
setInteractions((prev) => createInteractionRecord(interaction, prev))
}
})

useInteractionUpdate((interaction) => {
if (shouldUpdateRecords(interaction, flows)) {
setFocusedItem(interaction.id)
setInteractions((prev) => updateInteractionRecord(interaction, prev))
}
})
Expand Down

0 comments on commit fc97675

Please sign in to comment.