ios: disable self-destruct on LA mode change to "system", create new profile with past timestamp (#2416)

This commit is contained in:
Evgeny Poberezkin
2023-05-10 09:06:18 +02:00
committed by GitHub
parent 63f344bde6
commit df4e954f8a
4 changed files with 14 additions and 9 deletions

View File

@@ -125,8 +125,8 @@ func apiGetActiveUser() throws -> User? {
}
}
func apiCreateActiveUser(_ p: Profile?) throws -> User {
let r = chatSendCmdSync(.createActiveUser(profile: p))
func apiCreateActiveUser(_ p: Profile?, sameServers: Bool = false, pastTimestamp: Bool = false) throws -> User {
let r = chatSendCmdSync(.createActiveUser(profile: p, sameServers: sameServers, pastTimestamp: pastTimestamp))
if case let .activeUser(user) = r { return user }
throw r
}

View File

@@ -58,7 +58,7 @@ struct LocalAuthView: View {
if let displayName = displayName, displayName != "" {
profile = Profile(displayName: displayName, fullName: "")
}
m.currentUser = try apiCreateActiveUser(profile)
m.currentUser = try apiCreateActiveUser(profile, pastTimestamp: true)
onboardingStageDefault.set(.onboardingComplete)
m.onboardingStage = .onboardingComplete
try startChat()

View File

@@ -338,6 +338,7 @@ struct SimplexLockView: View {
switch laResult {
case .success:
_ = kcAppPassword.remove()
resetSelfDestruct()
laAlert = .laTurnedOnAlert
case .failed, .unavailable:
currentLAMode = .passcode