Auto select photo avatar
This commit is contained in:
parent
23e5606482
commit
0322acd7f1
@ -44,6 +44,22 @@ public enum AvatarType: Equatable {
|
||||
case .text: return true
|
||||
}
|
||||
}
|
||||
|
||||
public static func ==(lhs: AvatarType, rhs: AvatarType) -> Bool {
|
||||
switch (lhs, rhs) {
|
||||
case (.image(let lhs), .image(let rhs)):
|
||||
// We implement a custom "Equatable", since two URLs
|
||||
// are equatated with object equality, and even with
|
||||
// the same URL treated as different objects with the
|
||||
// compiler synthesized function.
|
||||
return lhs.path == rhs.path
|
||||
case (.icon(let lhs), .icon(let rhs)):
|
||||
return lhs == rhs
|
||||
case (.text(let lhs), .text(let rhs)):
|
||||
return lhs == rhs
|
||||
default: return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum AvatarIcon: String, CaseIterable {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user