mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-23 03:36:34 +10:00
fix delete avatar
This commit is contained in:
@@ -244,14 +244,14 @@ class AvatarCache {
|
||||
}
|
||||
|
||||
} else {
|
||||
// 换了 Avatar,删除旧的 // TODO: need test
|
||||
// 换了 Avatar,删除旧的
|
||||
dispatch_async(dispatch_get_main_queue()) {
|
||||
let realm = RLMRealm.defaultRealm()
|
||||
|
||||
realm.beginWriteTransaction()
|
||||
|
||||
// 不能直接使用 user.avatar, 因为 realm 不同
|
||||
if let avatar = avatarWithAvatarURLString(user.avatar!.avatarURLString) {
|
||||
if let avatar = avatarWithAvatarURLString(user.avatarURLString) {
|
||||
realm.deleteObject(avatar)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user