Fix profile picture handling
This commit is contained in:
parent
31f1a2e827
commit
cdf27a631a
|
@ -74,7 +74,7 @@ public final class FileServerAPIV2 : NSObject {
|
|||
// MARK: File Storage
|
||||
@objc(upload:)
|
||||
public static func objc_upload(file: Data) -> AnyPromise {
|
||||
return AnyPromise.from(upload(file))
|
||||
return AnyPromise.from(upload(file).map { String($0) })
|
||||
}
|
||||
|
||||
public static func upload(_ file: Data) -> Promise<UInt64> {
|
||||
|
|
|
@ -364,8 +364,8 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error);
|
|||
|
||||
AnyPromise *promise = [SNFileServerAPIV2 upload:encryptedAvatarData];
|
||||
|
||||
[promise.thenOn(dispatch_get_main_queue(), ^(uint64_t fileID) {
|
||||
NSString *downloadURL = [NSString stringWithFormat:@"%@/files/%llu", SNFileServerAPIV2.server, fileID];
|
||||
[promise.thenOn(dispatch_get_main_queue(), ^(NSString *fileID) {
|
||||
NSString *downloadURL = [NSString stringWithFormat:@"%@/files/%@", SNFileServerAPIV2.server, fileID];
|
||||
[NSUserDefaults.standardUserDefaults setObject:[NSDate new] forKey:@"lastProfilePictureUpload"];
|
||||
[self.localUserProfile updateWithProfileKey:newProfileKey dbConnection:self.dbConnection completion:^{
|
||||
successBlock(downloadURL);
|
||||
|
|
Loading…
Reference in New Issue