-
-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a0e0cf
commit 226f0b8
Showing
1 changed file
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +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 isSurveyShown = false; | ||
private surveyDidShow = false; | ||
async isFirstInstance(): Promise<boolean> { | ||
if (this.isSurveyShown) { | ||
if (this.surveyDidShow) { | ||
return false; | ||
} | ||
return (this.isSurveyShown = true); | ||
this.surveyDidShow = true; | ||
return this.surveyDidShow; | ||
} | ||
} |