From 25ec0fd3641b19d430a60c3f25dffe5819abef68 Mon Sep 17 00:00:00 2001 From: Shine Li Date: Wed, 18 Dec 2024 12:20:40 +0800 Subject: [PATCH] fix: fix initial session count (#2473) --- .../passport/sdk/src/zkEvm/sessionActivity/sessionActivity.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/passport/sdk/src/zkEvm/sessionActivity/sessionActivity.ts b/packages/passport/sdk/src/zkEvm/sessionActivity/sessionActivity.ts index 9c68fa18db..13e5bde985 100644 --- a/packages/passport/sdk/src/zkEvm/sessionActivity/sessionActivity.ts +++ b/packages/passport/sdk/src/zkEvm/sessionActivity/sessionActivity.ts @@ -33,6 +33,9 @@ syncSendCount(); const incrementSendCount = (clientId: string) => { syncSendCount(); + if (!sendCount[clientId]) { + sendCount[clientId] = 0; + } sendCount[clientId]++; setItem(SESSION_ACTIVITY_COUNT_KEY, sendCount); // Reset checkCount to zero on sending