Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loading dialog stays untill all tracks are rendered #114

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

TeunHuijben
Copy link
Collaborator

Previously, the "loading" dialog disappeared when all cells are selected. This is usually a lot faster than fetching and rendering all the tracks. In this PR, I have added the functionality, that the loading dialog stays until all tracks are actually rendered on the screen.

I have created Promises that are keeping track of each track and lineage being rendered. A .finally() statements checks when all promises are full-filled, and then removes the loading-dialog.

Promises are new to me, so I am not sure if this is the best implementation. But the warning dialog works, and it doesn't seem to impact performance, since all the fetching and rendering still happen asynchronously.

Copy link

vercel bot commented Sep 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
points-web-viewer ✅ Ready (Inspect) Visit Preview Oct 5, 2024 0:34am

@aganders3
Copy link
Collaborator

Thanks for diving into this - the nested logic here is pretty confusing. I am kind of surprised the rendering can take so much time after the fetch but either way I think I understand what you've done and it seems more correct.

One thing I will note is that you may want Promise.allSettled instead of Promise.all. Or if Promise.all fails you might want to set an error somewhere to indicate some track failed to fetch/render.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants