fix(tag-table): sorting of images w/o date. (#288)

E.g. OCI build-cache doesn't have a created date available, which leads to an error due to `creationDate` being undefined.
This commit is contained in:
Steffen Butzer 2023-03-16 20:54:22 +01:00 committed by GitHub
parent 564bc4b0b4
commit 6a8d984315
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -265,8 +265,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
if (this.state.orderType === 'date') {
sortedTags.sort((e1, e2) =>
!this.state.desc
? e2.creationDate.getTime() - e1.creationDate.getTime()
: e1.creationDate.getTime() - e2.creationDate.getTime()
? (e2.creationDate?.getTime()||0) - (e1.creationDate?.getTime()||0)
: (e1.creationDate?.getTime()||0) - (e2.creationDate?.getTime()||0)
);
} else if (this.state.orderType === 'size') {
sortedTags.sort((e1, e2) => (!this.state.desc ? e2.size - e1.size : e1.size - e2.size));