liusong1111 / synapse-extension

MIT License
0 stars 0 forks source link

[ui][refactor]loading state #25

Open liusong1111 opened 4 years ago

liusong1111 commented 4 years ago

https://github.com/rebase-network/synapse-extension/blob/a12c8def62a5d1c247b35b79b0d05f3d4c5b4859/src/ui/Components/TokenList/index.tsx#L33

https://github.com/rebase-network/synapse-extension/blob/a12c8def62a5d1c247b35b79b0d05f3d4c5b4859/src/ui/Components/TokenList/index.tsx#L69

const resultElem = <TokenListComponent udtsCapacity={udtsCapacity} udtsMeta={udtsMeta} />;

loading is false only if both udtsCapacity and udtsMeta are loaded. otherwise, it will show "No UDT found" shortly, and then the real things. event more, If udtsCapacity loads faster than udtsMeta, TokenListComponent will render error.