Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/shared/actions/terms.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ const { getService } = services.terms;
* @return {Promise}
*/
function getTermsDone(entity, tokens, mockAgreed) {
if (!tokens || !tokens.tokenV3) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The check for !tokens || !tokens.tokenV3 is a good safeguard, but consider logging this as an error instead of a warning if tokenV3 is expected to be always present. This could help in identifying potential issues in the token generation or passing process.

// eslint-disable-next-line no-console
console.warn(
"getTermsDone called without a valid tokenV3, skipping API call",
);
return Promise.resolve({ entity, terms: [] });
}
const service = getService(tokens.tokenV3);
let termsPromise;

Expand Down
Loading