mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-21 21:10:15 +00:00
android, desktop: start/stop chat toggle refactoring (#5261)
* android, desktop: start/stop chat toggle refactoring * changes * translations * better * better * do not start chat after export, always show run toggle (#5283) * update heading --------- Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>
This commit is contained in:
co-authored by
Evgeny Poberezkin
parent
961bdbfc59
commit
4738286f4e
+2
@@ -3,6 +3,7 @@ package chat.simplex.common.platform
|
||||
import chat.simplex.common.model.*
|
||||
import chat.simplex.common.simplexWindowState
|
||||
import chat.simplex.common.views.call.RcvCallInvitation
|
||||
import chat.simplex.common.views.database.deleteOldChatArchive
|
||||
import chat.simplex.common.views.helpers.*
|
||||
import java.util.*
|
||||
import chat.simplex.res.MR
|
||||
@@ -30,6 +31,7 @@ fun initApp() {
|
||||
override fun showMessage(title: String, text: String) = chat.simplex.common.model.NtfManager.showMessage(title, text)
|
||||
}
|
||||
applyAppLocale()
|
||||
deleteOldChatArchive()
|
||||
if (DatabaseUtils.ksSelfDestructPassword.get() == null) {
|
||||
initChatControllerOnStart()
|
||||
}
|
||||
|
||||
+2
-2
@@ -9,14 +9,14 @@ import kotlinx.datetime.Instant
|
||||
actual fun restartChatOrApp() {
|
||||
if (chatModel.chatRunning.value == false) {
|
||||
chatModel.chatDbChanged.value = true
|
||||
startChat(chatModel, mutableStateOf(Instant.DISTANT_PAST), chatModel.chatDbChanged)
|
||||
startChat(chatModel, mutableStateOf(Instant.DISTANT_PAST), chatModel.chatDbChanged, mutableStateOf(false))
|
||||
} else {
|
||||
authStopChat(chatModel) {
|
||||
withBGApi {
|
||||
// adding delay in order to prevent locked database by previous initialization
|
||||
delay(1000)
|
||||
chatModel.chatDbChanged.value = true
|
||||
startChat(chatModel, mutableStateOf(Instant.DISTANT_PAST), chatModel.chatDbChanged)
|
||||
startChat(chatModel, mutableStateOf(Instant.DISTANT_PAST), chatModel.chatDbChanged, mutableStateOf(false))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user