swarmcity / boardwalk-ts

Boardwalk implementation in TS
boardwalk-ts.vercel.app
MIT License
1 stars 0 forks source link

feat: automatically update item status #118

Closed filoozom closed 2 years ago

filoozom commented 2 years ago

I've confirmed that it correctly updates the items from useMarketplaceItems, but it doesn't seem to update the UI. Maybe @vojtechsimetka has more insight regarding that?

This also fixes side effects when useMarketplaceItems was called multiple times. This issue might not have manifested itself in the past as wakuItems.lastUpdate and chainItems.lastUpdate didn't update without doing a whole refresh (e.g. different marketplace).

github-actions[bot] commented 2 years ago

🐝 PR preview in Swarm

Preview URL: https://bah5acgzal5wchtv43gk2eougx6xt5sli4o5foorrtzobhyzl2znndvucwgwq.bzz.link Swarm Hash: 5f6c23cebcd995a23a86bfaf3ec968e3ba573a319e5c13e32bd65ad1d682b1ad Commit Hash: 83a671b917e1a441b85dd0cf31ea6d58ccc0bf66 Commit Message: feat: automatically update item status

filoozom commented 2 years ago

Did you check this in the UI component? My thinking is that maybe the event gets called but the app state does not change and hence the re-render is not triggered.

I had a quick look but figured that this is your domain so I'd let you check that out... 😅 I can do it if you want though.

vojtechsimetka commented 2 years ago

Not sure I get to it today but tomorrow morning I will.

vojtechsimetka commented 2 years ago

So this actually works for me but only for the payout event. I have suspicion that the funding event does not trigger this.

filoozom commented 2 years ago

Funding event fixed in https://github.com/swarmcity/boardwalk-contracts/commit/7a66c5c50e7115fb4819e43d90a08486c03df45a

filoozom commented 2 years ago

@vojtechsimetka so actually it works on the item list, but not on one specific item, because that uses useMarketplaceItem which doesn't follow the events. I'm going to open a separate PR for that.

filoozom commented 2 years ago

Actually I just pushed it here: https://github.com/swarmcity/boardwalk-ts/commit/1587b20caef2bfde51398b15294e44add62925f3