Closed bicep closed 5 years ago
newState.blockList.map((block) => {
if (block.tag === 'lastBlock') block.value = payload.toString();
});
This code is painful. I think that the initialState object should not contain an array. Each entry in the header should just have its own property in the object.
The problem with switching initialState from an array is that the TopBlocks
component relies on it being an array. What do you propose we do instead?
I was thinking an object, but I think it'll be painful for other reasons too 😅
Any updates on this PR? @TalAter this PR is very similar to the one I just submitted for latest Transaction. Let me know what you think.
@TalAter
@bicep I tried merging this one, but it seems to have diverged too much from master. I resolved the conflicts but it still didn't work. Would you like to fix this and resubmit, or should I close it?
Hi I'd like to try to resolve this.
Should I submit a new PR since you closed this one? @TalAter
I think that might be easiest for you considering the time that has passed.
Once the promise in the
getLatestBlock
action is fulfilled, thegetLatestBlockFulfilled
action is run and the action is handled (see reducer/topBlocks.js) and passed onto the new state. This updates props that is passed into the TopBlocks component.Related Issue
78
How Has This Been Tested?
The app displays the latest block if you run
dav-cli -s
.