aeternity / aescan

Block Explorer and Analytics Platform
ISC License
6 stars 3 forks source link

Improve NFT fetching #517

Open janmichek opened 1 year ago

janmichek commented 1 year ago
          This isn't an ideal solution because now the nft details get fetched both on frontend and SSR, but I guess it's fine for now. We can improve it later

_Originally posted by @lukeromanowicz in https://github.com/aeternity/aescan/pull/513#discussion_r1332570901_

lukeromanowicz commented 1 year ago

Ideally, all data that can be fetched on SSR should be fetched through useAsyncData so it doesn't get refetched on the client side. In the mentioned case, it wasn't working for some reason so we need to investigate why error wasn't passed properly while in other similar cases, it works just fine. It might have something to do with using Promise.allSettled inside the data fetching function or serialization issues when passing the error object from SSR to client side.