readium / swift-toolkit

A toolkit for ebooks, audiobooks and comics written in Swift
https://readium.org/mobile/
BSD 3-Clause "New" or "Revised" License
256 stars 100 forks source link

Turn off spinner if spread doesn't begin loading #397

Closed ettore closed 6 months ago

ettore commented 6 months ago

If the spread does begin to load, it will send a spreadLoadStarted event that will keep the spinner spinning.

This may happen if for example there's a broken/corrupted DRM key: this will cause content decryption to fail and therefore the spread won't be able to load.

This solves Issue #396 .

ettore commented 6 months ago

I left quite a few debug statements in, but I thought they would be helpful to document what's going on. Let me know if I should remove some.

ettore commented 6 months ago

not sure why the Carthage integration checks always fail... 🤔

ettore commented 6 months ago

I just added a commit to handle some yarn generated files. After some research, I have added some of them to source control and git-ignored others. Let me know if you have any preferences here.

ettore commented 6 months ago

Did you use make scripts from the root of the repo, to regenerate the JS files?

I did... it seems like I was supposed to run it from Sources/Navigator/EPUB/Scripts? if so I can remove them and run the scripts from there.

ettore commented 6 months ago

Did you use make scripts from the root of the repo, to regenerate the JS files?

I did... it seems like I was supposed to run it from Sources/Navigator/EPUB/Scripts? if so I can remove them and run the scripts from there.

I just tried to run make scripts from inside Sources/Navigator/EPUB/Scripts but there's no Makefile there.

ettorepasquini@cube25 (fix/neverending-loading-state +$<) ~/git/swift-toolkit/Sources/Navigator/EPUB/Scripts: make scripts
make: *** No rule to make target `scripts'.  Stop.

The Makefile is at the root of the repo; not sure if that should be moved to the Sources/Navigator/EPUB/Scripts dir?

mickael-menu commented 6 months ago

I did... it seems like I was supposed to run it from Sources/Navigator/EPUB/Scripts? if so I can remove them and run the scripts from there.

No it's made to be run from the root. It automatically moves to Sources/Navigator/EPUB/Scripts.

I'm confused why it generated these files. I tried from a fresh clone and didn't have the issue:

git clone git@github.com:readium/swift-toolkit.git
cd swift-toolkit
make scripts

I think you can just remove these files for the PR, the rest looks fine.

ettore commented 6 months ago

I think you can just remove these files for the PR, the rest looks fine.

Done.

Very weird: I just reran make scripts (from the root) and it did not generate them anymore. Maybe my yarn setup was incorrect: I reran

corepack enable
yarn init -2

but this time from the scripts directory instead from the root as I initially did. Anyways, I'm not going to fight it 😅