Implement survey notification (#1035)

This commit is contained in:
Francesco Spissu
2022-06-17 10:17:42 +02:00
committed by GitHub
parent a9aac0dbb0
commit f5cee97fef
7 changed files with 160 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import { injectable } from '@theia/core/shared/inversify';
import { SurveyNotificationService } from '../common/protocol/survey-service';
/**
* Service for checking if it is the first instance of the IDE, in this case it sets a flag to true.
* This flag is used to prevent the survey notification from being visible in every open window. It must only be shown on one window.
*/
@injectable()
export class SurveyNotificationServiceImpl
implements SurveyNotificationService
{
private surveyDidShow = false;
async isFirstInstance(): Promise<boolean> {
if (this.surveyDidShow) {
return false;
}
this.surveyDidShow = true;
return this.surveyDidShow;
}
}