ios: restore db (#1063)

* wip

* wip

* wip

* refactor

* clean up

* simplify

* simplify

* refactor

* rename

* rename consts

* refactor

Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
This commit is contained in:
JRobertsandEvgeny Poberezkin authored and GitHub committed 2022-09-17 16:41:20 +04:00
1 parent 3351503744
commit 2eca3e789c
5 files changed
+107 -12

No files matched your search

+4
View File
@@ -663,6 +663,10 @@ func initializeChat(start: Bool, dbKey: String? = nil) throws {
let m = ChatModel.shared
(m.chatDbEncrypted, m.chatDbStatus) = migrateChatDatabase(dbKey)
if m.chatDbStatus != .ok { return }
// If we migrated successfully means previous re-encryption process on database level finished successfully too
if encryptionStartedDefault.get() {
encryptionStartedDefault.set(false)
}
let _ = getChatCtrl(dbKey)
try apiSetFilesFolder(filesFolder: getAppFilesDirectory().path)
try apiSetIncognito(incognito: incognitoGroupDefault.get())