Update logic for NPS survey for existing accounts > 90 days

This commit is contained in:
Senthamil Sindhu 2024-01-18 09:22:46 -08:00
parent 0975591945
commit 889cf77801

View File

@ -302,17 +302,11 @@ export default class Explorer {
this.sendNPSMessage(); this.sendNPSMessage();
} }
} else { } else {
// An existing account is older than 3 days but less than 90 days old. For existing account show to 100% of users in Data Explorer. // Display survey when an existing account is older than 3 days but less than 90 days old. Also, show for accounts greater than 90 days old. For existing account show to 100% of users in Data Explorer.
if ( if (
!isAccountNewerThanThresholdInMs(userContext.databaseAccount?.systemData?.createdAt || "", THREE_DAYS_IN_MS) && !isAccountNewerThanThresholdInMs(userContext.databaseAccount?.systemData?.createdAt || "", THREE_DAYS_IN_MS)
isAccountNewerThanNinetyDays
) { ) {
this.sendNPSMessage(); this.sendNPSMessage();
} else {
// An existing account is greater than 90 days. For existing account show to random 33% of users in Data Explorer.
if (this.getRandomInt(100) < 33) {
this.sendNPSMessage();
}
} }
} }
} }