From c8b3b441567fa5db5ebddfccd4da401daa13136f Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 25 Aug 2020 13:15:03 +0200 Subject: [PATCH] Show all council motions (#3510) * Show all council motions * Update packages/page-calendar/src/useScheduled.ts --- packages/page-calendar/src/useScheduled.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/page-calendar/src/useScheduled.ts b/packages/page-calendar/src/useScheduled.ts index 7aebdd53d0..ffc745d38f 100644 --- a/packages/page-calendar/src/useScheduled.ts +++ b/packages/page-calendar/src/useScheduled.ts @@ -46,8 +46,8 @@ function createConstDurations (bestNumber: BlockNumber, blockTime: number, items } function createCouncilMotions (bestNumber: BlockNumber, blockTime: number, motions: DeriveCollectiveProposal[]): [EntryType, EntryInfo[]][] { - return motions - .map(({ hash, votes }): [EntryType, EntryInfo[]] | null => { + return [['councilMotion', motions + .map(({ hash, votes }): EntryInfo | null => { if (!votes) { return null; } @@ -55,15 +55,16 @@ function createCouncilMotions (bestNumber: BlockNumber, blockTime: number, motio const hashStr = hash.toHex(); const blocks = votes.end.sub(bestNumber); - return ['councilMotion', [{ + return { ...newDate(blocks, blockTime), blockNumber: votes.end, blocks, info: `${hashStr.substr(0, 6)}…${hashStr.substr(-4)}`, type: 'councilMotion' - }]]; + }; }) - .filter((item): item is [EntryType, EntryInfo[]] => !!item); + .filter((item): item is EntryInfo => !!item) + ]]; } function createDispatches (bestNumber: BlockNumber, blockTime: number, dispatches: DeriveDispatch[]): [EntryType, EntryInfo[]][] {