1
0
mirror of https://github.com/arduino/arduino-ide.git synced 2025-06-25 13:36:33 +00:00
2022-06-17 10:17:42 +02:00

21 lines
683 B
TypeScript

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;
}
}