Predidit / oneAnime

一款简洁清爽无广告的看番软件。 一款带弹幕的 anime1 第三方客户端,界面符合 Material You 规范。
GNU General Public License v3.0
592 stars 11 forks source link

Fix: HistoryController in history page and that in video page referen… #4

Closed songbirdzz closed 3 months ago

songbirdzz commented 3 months ago

Description

修复了由于anime card中的historyController与video page中historyController分别引用了两个不同的HistoryController class实例,从而导致两个实例中history list不同步的问题。这个问题会导致断点播放的错误。

PS:或许可以考虑直接操作GStorage.history,不操作history的list?

Predidit commented 3 months ago

此pr与我还未提交的更改存在冲突,我会在明天上午合并此pr,以你的更正为准。

Predidit commented 3 months ago

在处理完本地的冲突后,此PR已经合并,需要说明的是,得益于 Modular 的依赖注入功能,这两个 historyController 是相同的,问题出在其他地方,但目前的解决方法是可行的。

songbirdzz commented 3 months ago

既然这样想了一下应该是update之后没在history里add,只add到了store。

不过在不同地方controller的identityHashCode的值是不一样的,因为这个我才以为是不同的instance。怎么会是呢。

Predidit commented 3 months ago

我明白问题出在哪了,historyController 的依赖注入在 /tab/my/history 路由下进行,当跳转到其他路由时便不再生效,注入本应该在 / 进行。稍后我会提交一个 commit 进行修复并更正前面的 work around