From abd0befe45612c5bde3ac6306791ef68676752b8 Mon Sep 17 00:00:00 2001 From: dalechyn Date: Fri, 26 Jul 2024 19:54:06 +0300 Subject: [PATCH] fix: signature and transaction contexts are always posts --- src/utils/getSignatureContext.ts | 2 +- src/utils/getTransactionContext.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/getSignatureContext.ts b/src/utils/getSignatureContext.ts index 96f98885..b99e0a15 100644 --- a/src/utils/getSignatureContext.ts +++ b/src/utils/getSignatureContext.ts @@ -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 diff --git a/src/utils/getTransactionContext.ts b/src/utils/getTransactionContext.ts index b9ae1357..31646a64 100644 --- a/src/utils/getTransactionContext.ts +++ b/src/utils/getTransactionContext.ts @@ -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({