Skip to content

Commit

Permalink
fix: signature and transaction contexts are always posts
Browse files Browse the repository at this point in the history
  • Loading branch information
dalechyn committed Jul 26, 2024
1 parent ef55cff commit abd0bef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/utils/getSignatureContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export async function getSignatureContext<
} = context || {}

const previousState = await (async () => {
if (context.status === 'initial') {
if (context?.previousState === undefined) {
if (typeof parameters.initialState === 'function')
return await (parameters.initialState as any)(contextHono)
return parameters.initialState
Expand Down
4 changes: 2 additions & 2 deletions src/utils/getTransactionContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ export async function getTransactionContext<
} = context || {}

const previousState = await (async () => {
if (context.status === 'initial') {
if (context?.previousState === undefined) {
if (typeof parameters.initialState === 'function')
return await (parameters.initialState as any)(contextHono)
return parameters.initialState
}
return context?.previousState
return context.previousState
})()

const { buttonValue, inputText } = getIntentState({
Expand Down

0 comments on commit abd0bef

Please sign in to comment.