fix(governance): change proposal sort order (#3716)

This commit is contained in:
Sam Keen 2023-05-11 13:39:30 +01:00 committed by GitHub
parent 653cec2592
commit bf73559c30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -24,7 +24,6 @@ const openProposalClosesNextMonth = generateProposal({
}, },
terms: { terms: {
closingDatetime: nextMonth.toString(), closingDatetime: nextMonth.toString(),
enactmentDatetime: nextMonth.toString(),
}, },
}); });
@ -36,7 +35,6 @@ const openProposalClosesNextWeek = generateProposal({
}, },
terms: { terms: {
closingDatetime: nextWeek.toString(), closingDatetime: nextWeek.toString(),
enactmentDatetime: nextWeek.toString(),
}, },
}); });
@ -45,7 +43,6 @@ const enactedProposalClosedLastWeek = generateProposal({
state: ProposalState.STATE_ENACTED, state: ProposalState.STATE_ENACTED,
terms: { terms: {
closingDatetime: lastWeek.toString(), closingDatetime: lastWeek.toString(),
enactmentDatetime: lastWeek.toString(),
}, },
}); });
@ -54,7 +51,6 @@ const failedProposalClosedLastMonth = generateProposal({
state: ProposalState.STATE_FAILED, state: ProposalState.STATE_FAILED,
terms: { terms: {
closingDatetime: lastMonth.toString(), closingDatetime: lastMonth.toString(),
enactmentDatetime: lastMonth.toString(),
}, },
}); });

View File

@ -20,8 +20,11 @@ import { useProtocolUpgradeProposalsQuery } from '@vegaprotocol/proposals';
const orderByDate = (arr: ProposalFieldsFragment[]) => const orderByDate = (arr: ProposalFieldsFragment[]) =>
orderBy( orderBy(
arr, arr,
[(p) => new Date(p?.terms?.closingDatetime).getTime(), (p) => p.id], [
['desc', 'desc'] (p) => new Date(p?.terms?.closingDatetime).getTime(),
(p) => new Date(p?.datetime).getTime(),
],
['asc', 'asc']
); );
const orderByUpgradeBlockHeight = ( const orderByUpgradeBlockHeight = (