mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-14 12:49:28 +00:00
Implement survey notification (#1035)
This commit is contained in:
20
arduino-ide-extension/src/node/survey-service-impl.ts
Normal file
20
arduino-ide-extension/src/node/survey-service-impl.ts
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user