File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -1287,6 +1287,8 @@ export class CliRepl implements MongoshIOProvider {
12871287 latest :
12881288 await this . updateNotificationManager . getLatestVersionIfMoreRecent ( '' ) ,
12891289 currentVersion,
1290+ hasGreetingCTA :
1291+ ! ! ( await this . updateNotificationManager . getGreetingCTAForCurrentVersion ( ) ) ,
12901292 } ) ;
12911293 } catch ( err : any ) {
12921294 this . bus . emit ( 'mongosh:error' , err , 'startup' ) ;
Original file line number Diff line number Diff line change @@ -184,9 +184,13 @@ export class UpdateNotificationManager {
184184 latestKnownMongoshVersion : this . latestKnownMongoshVersion ,
185185 cta : {
186186 [ currentVersion ] : this . currentVersionGreetingCTA ,
187- ...( this . latestKnownMongoshVersion && {
188- [ this . latestKnownMongoshVersion ] : latestKnownVersionCTA ,
189- } ) ,
187+
188+ // Add the latest known version's CTA if we're not already on latest. This could be used
189+ // next time we start mongosh if the user has updated to latest.
190+ ...( this . latestKnownMongoshVersion &&
191+ this . latestKnownMongoshVersion !== currentVersion && {
192+ [ this . latestKnownMongoshVersion ] : latestKnownVersionCTA ,
193+ } ) ,
190194 } ,
191195 } ;
192196 await fs . writeFile ( localFilePath , JSON . stringify ( localFileContents ) ) ;
Original file line number Diff line number Diff line change @@ -179,6 +179,7 @@ export interface FetchingUpdateMetadataEvent {
179179export interface FetchingUpdateMetadataCompleteEvent {
180180 latest : string | null ;
181181 currentVersion : string ;
182+ hasGreetingCTA : boolean ;
182183}
183184
184185export interface SessionStartedEvent {
You can’t perform that action at this time.
0 commit comments