From cfbca4b0fd7ea8af1670d0e3d0cf978539183775 Mon Sep 17 00:00:00 2001 From: Rokt33r Date: Mon, 4 Jan 2016 16:38:24 +0900 Subject: [PATCH] list bug fix --- browser/main/HomePage/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/browser/main/HomePage/index.js b/browser/main/HomePage/index.js index 9d9e0769..c46cb830 100644 --- a/browser/main/HomePage/index.js +++ b/browser/main/HomePage/index.js @@ -143,7 +143,11 @@ function remap (state) { let modified = _articles != null ? _articles.modified : [] articles.sort((a, b) => { - return new Date(b.updatedAt) - new Date(a.updatedAt) + let match = new Date(b.updatedAt) - new Date(a.updatedAt) + if (match === 0) match = new Date(b.createdAt) - new Date(a.createdAt) + if (match === 0) match = b.title.compare(a.title) + if (match === 0) match = b.key.compare(a.key) + return match }) let allArticles = articles.slice()