File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ const BUTTON_TEXT_NOT_NOW = "Not Now";
1717const SECONDS_IN_A_DAY = 24 * 60 * 60 ;
1818const SECONDS_COUNT_BEFORE_NOTIFICATION_RESHOW = 10 * SECONDS_IN_A_DAY ;
1919
20+ function getNowTs ( ) {
21+ return Number ( new Date ( ) ) / 1000 ;
22+ }
23+
2024class NotificationManager implements IUpgradeIssuesRenderer {
2125 private hasShown = false ;
2226 private context ?: ExtensionContext ;
@@ -39,8 +43,6 @@ class NotificationManager implements IUpgradeIssuesRenderer {
3943 }
4044 this . hasShown = true ;
4145
42- this . setNextShowTs ( ( Number ( new Date ( ) ) / 1000 ) + SECONDS_COUNT_BEFORE_NOTIFICATION_RESHOW ) ;
43-
4446 if ( ! this . shouldShow ( ) ) {
4547 return ;
4648 }
@@ -62,7 +64,7 @@ class NotificationManager implements IUpgradeIssuesRenderer {
6264 break ;
6365 }
6466 case BUTTON_TEXT_NOT_NOW : {
65- this . setNextShowTs ( - 1 * SECONDS_COUNT_BEFORE_NOTIFICATION_RESHOW ) ;
67+ this . setNextShowTs ( getNowTs ( ) + SECONDS_COUNT_BEFORE_NOTIFICATION_RESHOW ) ;
6668 break ;
6769 }
6870 }
@@ -72,7 +74,7 @@ class NotificationManager implements IUpgradeIssuesRenderer {
7274
7375 private shouldShow ( ) {
7476 return Settings . getEnableDependencyCheckup ( )
75- && ( ( this . getNextShowTs ( ) ?? 0 ) <= ( Number ( new Date ( ) ) / 1000 ) ) ;
77+ && ( ( this . getNextShowTs ( ) ?? 0 ) <= getNowTs ( ) ) ;
7678 }
7779
7880 private getNextShowTs ( ) {
You can’t perform that action at this time.
0 commit comments