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

fix(error-display): update display on consecutive errors #8485

Merged
merged 1 commit into from
Nov 28, 2023

Commits on Nov 5, 2023

  1. fix(error-display): update display on consecutive errors

    When consecutive errors occur, the `ErrorDisplay` component is not updated with the new error message.
    This results in an inconsistent state between the `player.error` and `player.errorDisplay.contentEl().textContent`.
    
    |                         | player.error() | player.errorDisplay.content() | player.errorDisplay.contentEl().textContent |
    | ----------------------- | -------------- | ----------------------------- | ------------------------------------------- |
    | player.error('Error 1') | Error 1 ✔️      | Error 1 ✔️                     | Error 1 ✔️                                   |
    | player.error('Error 2') | Error 2 ✔️      | Error 2 ✔️                     | Error 1 ❌                                  |
    
    An example of a use case where updating the error message is useful is :
    - user tries to play media 1 but the media doestn't exist
    - user tries to play media 2 but the media is not compatible
    
    - call the `close` function before each call to the `open` function.
      - if errorDisplay is not **open**, the `close` function does nothing
      - if errorDisplay is **open**, the `close` function executes and triggers the close events, then the open function executes and triggers the open events, ensuring that the content is updated.
    amtins committed Nov 5, 2023
    Configuration menu
    Copy the full SHA
    b6a4769 View commit details
    Browse the repository at this point in the history