Skip to content

Commit

Permalink
fix: polling timeout when click is response t triggers another polling (
Browse files Browse the repository at this point in the history
#743) RELEASE

## Description
Fix a case when click is response t triggers another polling

tested ML and EL with short and long polling
  • Loading branch information
asafshen authored Jul 18, 2024
1 parent 52e4c00 commit fb92c03
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/sdks/web-component/src/lib/descope-wc/DescopeWc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,11 @@ class DescopeWc extends BaseDescopeWc {
componentsVersion,
) => {
if (action === RESPONSE_ACTIONS.poll) {
// Reset polling, in case it was already set, this may happen
// when the user clicks on a button that triggers a polling action
// while the polling timeout is already running
this.#resetPollingTimeout();

// schedule next polling request for 2 seconds from now
this.#pollingTimeout = setTimeout(async () => {
let sdkResp;
Expand Down

0 comments on commit fb92c03

Please sign in to comment.