TF-2464 Save both EmailDelivery and EmailState in the keychain

Signed-off-by: dab246 <tdvu@linagora.com>
(cherry picked from commit a37fe7ea8bcc38eb96df39f46128c9e1f7af046e)
This commit is contained in:
dab246
2024-01-17 13:20:59 +07:00
committed by Dat PHAM HOANG
parent 642121dea3
commit 274e01d113
9 changed files with 74 additions and 40 deletions
@@ -40,10 +40,10 @@ class KeychainController: KeychainControllerDelegate {
}
}
func updateEmailStateToKeychain(accountId: String, newState: String) {
func updateEmailDeliveryStateToKeychain(accountId: String, newEmailDeliveryState: String) {
do {
if let sharingSession = retrieveSharingSessionFromKeychain(accountId: accountId) {
let newSharingSession = sharingSession.updateEmailState(newState: newState)
let newSharingSession = sharingSession.updateEmailDeliveryState(newEmailDeliveryState: newEmailDeliveryState)
try keychain.set(newSharingSession.toJson() ?? "", key: accountId)
}
} catch {}