fix: 退出贴子页面保存历史记录时偶现闪退
This commit is contained in:
parent
17301cf540
commit
d4cad7045d
|
|
@ -392,7 +392,7 @@ object ThreadPageFrom {
|
||||||
sealed interface ThreadPageExtra
|
sealed interface ThreadPageExtra
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
object ThreadPageNoExtra : ThreadPageExtra
|
data object ThreadPageNoExtra : ThreadPageExtra
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class ThreadPageFromStoreExtra(
|
data class ThreadPageFromStoreExtra(
|
||||||
|
|
@ -772,6 +772,7 @@ fun ThreadPage(
|
||||||
LaunchedEffect(threadId, threadTitle, author, lastVisibilityPostId) {
|
LaunchedEffect(threadId, threadTitle, author, lastVisibilityPostId) {
|
||||||
val saveHistory = {
|
val saveHistory = {
|
||||||
thread {
|
thread {
|
||||||
|
runCatching {
|
||||||
if (threadTitle.isNotBlank()) {
|
if (threadTitle.isNotBlank()) {
|
||||||
HistoryUtil.saveHistory(
|
HistoryUtil.saveHistory(
|
||||||
History(
|
History(
|
||||||
|
|
@ -794,6 +795,7 @@ fun ThreadPage(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!savedHistory || lastVisibilityPostId != 0L) {
|
if (!savedHistory || lastVisibilityPostId != 0L) {
|
||||||
saveHistory()
|
saveHistory()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue