From 24a9f8d48aeb8046349ac69e6e881c07156daecd Mon Sep 17 00:00:00 2001 From: Paul Baecher Date: Tue, 27 Feb 2018 15:55:11 +0100 Subject: [PATCH] Fix unstable UI sorting with old data --- CHANGES.md | 1 + dashboard/components/FeatureList.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 1d6f974..a3074e9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ ### Bugfixes and minor changes * Slack notifier is now less spammy. +* Fix unstable UI sort edge case with old data. ## 1.0.0 diff --git a/dashboard/components/FeatureList.js b/dashboard/components/FeatureList.js index 79a2713..55fd29e 100644 --- a/dashboard/components/FeatureList.js +++ b/dashboard/components/FeatureList.js @@ -11,7 +11,7 @@ import './FeatureList.css' const sort = (features) => features.sort((a, b) => { if (a.created_at < b.created_at) return 1 if (a.created_at > b.created_at) return -1 - return 0 + return b.name < a.name ? -1 : b.name > a.name }) const parseStatus = (environments, status) =>