ui: delay closing support view on acceptance for items to be marked read (#6244)

* ui: delay closing support view on acceptance for items to be marked read

* move to coroutine

* increase delay
This commit is contained in:
spaced4ndy
2025-09-07 07:30:59 +00:00
committed by GitHub
parent ca9b0d4e43
commit 764ea39cdb
2 changed files with 10 additions and 4 deletions

View File

@@ -360,7 +360,10 @@ struct ChatView: View {
}
.onChange(of: chatModel.secondaryPendingInviteeChatOpened) { opened in
if im.secondaryIMFilter != nil && !opened {
dismiss()
Task {
try? await Task.sleep(nanoseconds: 650_000000)
dismiss()
}
}
}
.onChange(of: chatModel.openAroundItemId) { openAround in

View File

@@ -2913,10 +2913,13 @@ object ChatController {
&& ModalManager.end.hasModalOpen(ModalViewId.SECONDARY_CHAT)
&& chatModel.secondaryChatsContext.value?.secondaryContextFilter is SecondaryContextFilter.GroupChatScopeContext
) {
withContext(Dispatchers.Main) {
chatModel.secondaryChatsContext.value = null
CoroutineScope(Dispatchers.Default).launch {
delay(1000L)
withContext(Dispatchers.Main) {
chatModel.secondaryChatsContext.value = null
}
ModalManager.end.closeModals()
}
ModalManager.end.closeModals()
}
}
is CR.JoinedGroupMember ->