-
Notifications
You must be signed in to change notification settings - Fork 51
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
Disable Create Timeline button until derivative loads #4058
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently there is some JS which does a similar check and then reloads the page when a player can be displayed. Does it make sense to do it that way instead of adding another JS check? I'm thinking of adding the check:
<% if @currentStream.present? and @currentStream.derivatives.present? %>
around the partial render here:
<%= render partial: 'timeline' if current_ability.can? :create, Timeline %> |
@cjcolvar I tried using this if-block within the button, but I was not able to make it work. Let me try this way and see if it works 👍 |
@Dananji Oh, that's a good point. We probably just want to disable instead of not render so the UI is consistent. |
I used
And the button is not disabled when the player shows |
Ok, sorry, I think I understand now what this PR was initially trying to solve. I was thinking this was for the corner case where the derivatives were still being generated, but maybe this is more about just disabling the button until the player finishes loading the stream (to avoid issues with initializing the custom timeline start/end times?). If this is the case then maybe we want to do the same for the Add to Playlist button? And maybe the button should be disabled on page render but enabled by JS? |
@cjcolvar Yeah, I thought the same initially. |
I think just the icon on the player since it has custom start/end times but the buttons on the accordion don't. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me.
No description provided.