Chat Import fixes

This commit is contained in:
Ali
2021-01-25 01:52:48 +05:00
parent 0e21298773
commit 4b81b2cffa
5 changed files with 20 additions and 9 deletions

View File

@@ -508,8 +508,13 @@ public final class ChatImportActivityScreen: ViewController {
}
return ChatHistoryImport.uploadMedia(account: context.account, session: session, file: tempFile, fileName: fileName, mimeType: mimeTypeValue, type: mediaType)
|> mapError { _ -> ImportError in
return .generic
|> mapError { error -> ImportError in
switch error {
case .chatAdminRequired:
return .chatAdminRequired
case .generic:
return .generic
}
}
|> map { progress -> (String, Float) in
return (fileName, progress)