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 download state not being reactive in offline mode. #166

Merged
merged 1 commit into from
Nov 8, 2021

Conversation

dero
Copy link
Collaborator

@dero dero commented Oct 6, 2021

Summary

Fixes #127

The VideoDownloader instances take a little time to initialize, i.e. to fetch download status from IDB. After a hard refresh, the downloader instance usually still was in an indeterminate state, which the application incorrectly interpreted as the video not being downloaded locally.

I have updated the downloaded implementation to broadcast state changes and then hooked the single video page to listen to those changes. Once the downloader is initialized, the disabled class is removed from the wrapping article element in cases when the video is available, i. e. when it's available for offline playback.

Screencast to illustrate the fix

web-dev-offline-status-fix.mp4

@derekherman derekherman merged commit e2c06b8 into develop Nov 8, 2021
@derekherman derekherman deleted the fix/127-reactive-download-state-in-offline branch November 8, 2021 02:35
@felipebochehin87
Copy link

Tested against https://kinoweb-dev--staging-2ra3ji0i.web.app/

  1. Opened https://kinoweb-dev--staging-2ra3ji0i.web.app/
  2. Clicked on a video
  3. Clicked on "Make available offline"
  4. Clicked on Settings
  5. Toggled on "Show offline content only"
  6. Clicked on Kino icon
  7. Clicked on the video that is available offline
  8. Clicked on "Remove offline version"
  9. Clicked on "Undo" - download worked
  10. Clicked on "Make available offline" - download worked
  11. Clicked on "Remove offline version"
  12. Waited a few seconds - video was removed from the offline list, buttons were disabled and image background turned to gray ✔️
Kino.166.mp4

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

Successfully merging this pull request may close these issues.

Video greyed out and cannot click "remove offline version" after hard reload (Ctrl-Shift-R) in offline mode
3 participants