Skip to content

Commit

Permalink
Added backward compatibility to collection query sorting.
Browse files Browse the repository at this point in the history
Closes #701.
  • Loading branch information
imolorhe committed Apr 6, 2019
1 parent d98e10c commit 94933e2
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -95,8 +95,8 @@ export class QueryCollectionItemComponent implements OnInit {
});
case 'newest':
return this.collection.queries.sort((a, b) => {
const aTimeStamp = a.updated_at;
const bTimeStamp = b.updated_at;
const aTimeStamp = a.updated_at || a.windowName.toLowerCase();
const bTimeStamp = b.updated_at || b.windowName.toLowerCase();

if (aTimeStamp > bTimeStamp) {
return -1;
Expand All @@ -108,8 +108,8 @@ export class QueryCollectionItemComponent implements OnInit {
});
case 'oldest':
return this.collection.queries.sort((a, b) => {
const aTimeStamp = a.updated_at;
const bTimeStamp = b.updated_at;
const aTimeStamp = a.updated_at || a.windowName.toLowerCase();
const bTimeStamp = b.updated_at || b.windowName.toLowerCase();

if (aTimeStamp > bTimeStamp) {
return 1;
Expand Down

0 comments on commit 94933e2

Please sign in to comment.