Don't potentially allow showing survey multiple times if user does not interact with a previously shown survey

This commit is contained in:
Matt Bierner
2018-09-19 17:35:19 -07:00
parent f6b11178f7
commit fd80f0de8a

View File

@@ -90,6 +90,10 @@ class Survey {
return false;
}
public willShow() {
this._hasShownInThisSession = true;
}
public markComplete() {
this._hasShownInThisSession = true;
this.memento.update(this.isCompletedMementoKey, true);
@@ -131,6 +135,7 @@ export class Surveyor {
public surveyReady(surveyId: string): void {
const survey = this.tryGetActiveSurvey(surveyId);
if (survey && survey.trigger()) {
survey.willShow();
this.showSurveyToUser(survey);
}
}