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

Ending up with multiple icons when filepath changes fast #13

Open
dietergeerts opened this issue Oct 12, 2018 · 1 comment
Open

Ending up with multiple icons when filepath changes fast #13

dietergeerts opened this issue Oct 12, 2018 · 1 comment

Comments

@dietergeerts
Copy link

We use the simple svg to show the status of a document generation and finally the download icon for it. Because this changes fast, this component doesn't remove the first icon, as while setting the second, it was not yet loaded. This is what I can see while debugging:

  • generateInlineSVG is entered for the first filepath
  • generateInlineSVG is entered for the second filepath4
  • context.$el.appendChild(inlinedSVG) is run for the first filepath
  • context.$el.appendChild(inlinedSVG) is run for the second filepath

Because the previous icon is removed when the method is entered, if it was there, it's not in this case, as it wasn't added yet.

I know we can use the ready event, but that's just a workaround. This should be fixed, and probably improved by canceling the request when a new one is needed to be done.

@dietergeerts
Copy link
Author

Trying for the workaround with the ready event, I see now that it's impossible. When it goes wrong, we don't get notified of an error either... I don't know the good way of doing this, but it has to be changed so we are notified of being done, even if it was an error, and possibly a way to throw the error up, or hook it up to custom error handling, messaging to the user with i18n.

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

No branches or pull requests

1 participant