Skip to content

Commit

Permalink
fixed CSP internal client calls to avoid regression
Browse files Browse the repository at this point in the history
  • Loading branch information
marcvelmer committed Sep 7, 2023
1 parent bcac63f commit 489a068
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ export class VocdoniSDKClient {

async cspUrl(): Promise<string> {
invariant(this.electionId, 'No election id set');
return this.fetchElection(this.electionId).then(this.cspService.setUrlFromElection);
return this.fetchElection(this.electionId).then((election) => this.cspService.setUrlFromElection(election));
}

async cspInfo() {
Expand All @@ -1037,6 +1037,8 @@ export class VocdoniSDKClient {

async cspStep(stepNumber: number, data: any[], authToken?: string) {
invariant(this.electionId, 'No election id set');
await this.cspUrl();
await this.cspInfo();
return this.cspService.cspStep(this.electionId, stepNumber, data, authToken);
}

Expand Down

0 comments on commit 489a068

Please sign in to comment.