fix: sorting order

This commit is contained in:
Vyacheslav Matyukhin 2022-05-04 02:03:57 +04:00
parent 3ec3c873ff
commit 9973c25054
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C

View File

@ -57,7 +57,7 @@ const getVictoryGroup = ({ data, i }: { data: DataSet; i: number }) => {
export const HistoryChart: React.FC<Props> = ({ question }) => {
let dataSetsNames = question.options
.sort((a, b) => (a.probability < b.probability ? -1 : 1))
.sort((a, b) => (a.probability > b.probability ? -1 : 1))
.map((o) => o.name);
dataSetsNames = [...new Set(dataSetsNames)].slice(0, 5); // take the first 5