We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
master分支。
看堆栈是ProfileFragment.refreshData ->Play.isLogin ,但是不知道为什么触发到ArticleAdapter 的Play.isLogin().collectLatest,
The text was updated successfully, but these errors were encountered:
应该是Flow的问题.刷新登录状态的时候,之前的生产消费关系依然存在,导致了重复收藏,取消的问题,每点击一次,关系就会再次重新生成一次。可以尝试限制流的消费。
fun isLogin(): Flow<Boolean> { return if (::dataStore.isInitialized) { dataStore.readBooleanFlow(IS_LOGIN).take(1) } else { flow { emit(false) }.take(1) } }
虽然这样解决重复消费的问题,但是会有些瑕疵。可以在刷新的方法中,重新获取数据,而不是只改变登录状态。
Sorry, something went wrong.
No branches or pull requests
master分支。
看堆栈是ProfileFragment.refreshData ->Play.isLogin ,但是不知道为什么触发到ArticleAdapter 的Play.isLogin().collectLatest,
The text was updated successfully, but these errors were encountered: