Skip to content

Commit

Permalink
Merge pull request #12351 from richard-cox/fix-expires-sort-rder
Browse files Browse the repository at this point in the history
Ensure harvester cloud creds with expiration date of 0 are sorted correctly
  • Loading branch information
richard-cox authored Oct 25, 2024
2 parents ec2f92a + b7326da commit d5024a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions shell/models/cloudcredential.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@ export default class CloudCredential extends NormanModel {
}

get expiresForSort() {
// Why not just `expires`? Ensures the correct sort order of 'no expiration' --> 'expired' --> 'expiring'
// (instead of expired --> expiring --> no expiration)
return this.expires || Number.MAX_SAFE_INTEGER;
// Why not just `expires`? Ensures the correct sort order of expired --> expiring --> never expires
// (instead of 'never expired' --> 'expired' --> 'expiring')
return this.expires !== undefined ? this.expires : Number.MAX_SAFE_INTEGER;
}

get expires() {
Expand Down

0 comments on commit d5024a1

Please sign in to comment.