Skip to content

Commit

Permalink
fix(tag-table): sorting of images w/o date. (#288)
Browse files Browse the repository at this point in the history
E.g. OCI build-cache doesn't have a created date available, which leads to an error due to `creationDate` being undefined.
  • Loading branch information
steffengy committed Mar 16, 2023
1 parent 564bc4b commit 6a8d984
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/tag-list/tag-table.riot
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 6a8d984

Please sign in to comment.