fix: 修复几个 Bug

This commit is contained in:
HuanCheng65 2022-12-31 16:12:13 +08:00
parent cf72667290
commit dbd885fb9c
No known key found for this signature in database
GPG Key ID: E9031EF91A805148
2 changed files with 4 additions and 2 deletions

View File

@ -62,12 +62,13 @@ class LoginActivity : BaseActivity(), WebViewListener {
snackBar.show() snackBar.show()
launch { launch {
AccountUtil.fetchAccountFlow(bduss, sToken, cookies) AccountUtil.fetchAccountFlow(bduss, sToken, cookies)
.flowOn(Dispatchers.IO)
.catch { e -> .catch { e ->
snackBar.setText("登录失败 ${e.getErrorMessage()}") snackBar.setText("登录失败 ${e.getErrorMessage()}")
view.loadUrl("https://wappass.baidu.com/passport?login&u=https%3A%2F%2Ftieba.baidu.com%2Findex%2Ftbwise%2Fmine") view.loadUrl("https://wappass.baidu.com/passport?login&u=https%3A%2F%2Ftieba.baidu.com%2Findex%2Ftbwise%2Fmine")
handler.postDelayed({ snackBar.dismiss() }, 1500) handler.postDelayed({ snackBar.dismiss() }, 1500)
} }
.flowOn(Dispatchers.IO) .flowOn(Dispatchers.Main)
.collect { account -> .collect { account ->
AccountUtil.newAccount(account.uid, account) { AccountUtil.newAccount(account.uid, account) {
if (it) { if (it) {

View File

@ -756,7 +756,8 @@ class ThreadActivity : BaseActivity(), View.OnClickListener, IThreadMenuFragment
show(supportFragmentManager, "Menu") show(supportFragmentManager, "Menu")
} }
} }
R.id.thread_bottom_bar_agree -> if (dataBean != null && dataBean!!.thread != null) {
R.id.thread_bottom_bar_agree -> if (dataBean?.thread?.threadInfo?.threadId != null && dataBean?.thread?.threadInfo?.firstPostId != null) {
if (!agree) { if (!agree) {
agree = true agree = true
agreeNum += 1 agreeNum += 1