Skip to content

Commit 6a8d984

Browse files
authored
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.
1 parent 564bc4b commit 6a8d984

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/tag-list/tag-table.riot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
265265
if (this.state.orderType === 'date') {
266266
sortedTags.sort((e1, e2) =>
267267
!this.state.desc
268-
? e2.creationDate.getTime() - e1.creationDate.getTime()
269-
: e1.creationDate.getTime() - e2.creationDate.getTime()
268+
? (e2.creationDate?.getTime()||0) - (e1.creationDate?.getTime()||0)
269+
: (e1.creationDate?.getTime()||0) - (e2.creationDate?.getTime()||0)
270270
);
271271
} else if (this.state.orderType === 'size') {
272272
sortedTags.sort((e1, e2) => (!this.state.desc ? e2.size - e1.size : e1.size - e2.size));

0 commit comments

Comments
 (0)