mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-04-18 04:38:27 +00:00
Fix CardDAV editing
This commit is contained in:
parent
26022e7f09
commit
153ca0f6c4
2 changed files with 12 additions and 6 deletions
|
|
@ -2,6 +2,6 @@ import Foundation
|
|||
|
||||
public enum AppGitInfo {
|
||||
public static let branch = "release/6.2"
|
||||
public static let commit = "ae63f770f"
|
||||
public static let commit = "26022e7f0"
|
||||
public static let tag = "6.2.0-beta"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,10 +40,15 @@ class CardDavViewModel: ObservableObject {
|
|||
@Published var isReadOnly: Bool = false
|
||||
|
||||
var isFormComplete: Bool {
|
||||
!displayName.isEmpty &&
|
||||
!serverUrl.isEmpty &&
|
||||
!username.isEmpty &&
|
||||
!realm.isEmpty
|
||||
if !isEdit {
|
||||
!displayName.isEmpty &&
|
||||
!serverUrl.isEmpty &&
|
||||
!username.isEmpty &&
|
||||
!realm.isEmpty
|
||||
} else {
|
||||
!displayName.isEmpty &&
|
||||
!serverUrl.isEmpty
|
||||
}
|
||||
}
|
||||
|
||||
@Published var cardDavServerOperationInProgress = false
|
||||
|
|
@ -147,7 +152,7 @@ class CardDavViewModel: ObservableObject {
|
|||
|
||||
self.coreContext.doOnCoreQueue { core in
|
||||
// TODO: add dialog to ask user before removing existing friend list & auth info ?
|
||||
if !self.isEdit == false {
|
||||
if !self.isEdit {
|
||||
let foundFriendList = core.getFriendListByName(name: name)
|
||||
if let foundFriendList = foundFriendList {
|
||||
Log.warn("\(CardDavViewModel.TAG) Friend list \(name) already exists, removing it first")
|
||||
|
|
@ -177,6 +182,7 @@ class CardDavViewModel: ObservableObject {
|
|||
|
||||
if self.isEdit && self.friendList != nil {
|
||||
Log.info("\(CardDavViewModel.TAG) Changes were made to CardDAV friend list \(name), synchronizing it")
|
||||
self.addFriendListDelegate(friendList: self.friendList!)
|
||||
} else {
|
||||
self.friendList = try? core.createFriendList()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue