From 0a4ad08f1d124722acd4ee2f6920bf2f0cafc08a Mon Sep 17 00:00:00 2001 From: jinhojang6 Date: Sat, 13 Jul 2019 01:30:04 +0900 Subject: [PATCH] fix the sorting feature --- src/components/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/main.js b/src/components/main.js index 9beaa72..d808fc2 100644 --- a/src/components/main.js +++ b/src/components/main.js @@ -17,8 +17,8 @@ class Main extends Component { sortByLang() { const { postList } = this.state let newPostList = postList.sort((a,b)=> { - if (a.lang < b.lang) { return -1; } - if (a.lang > b.lang) { return 1; } + if (a.lang_en < b.lang_en) { return -1; } + if (a.lang_en > b.lang_en) { return 1; } return 0; });