mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
no message
This commit is contained in:
@@ -294,3 +294,23 @@ public func dropSecureId(network: Network, currentPassword: String) -> Signal<Vo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum GetAllSecureIdValuesError {
|
||||
case generic
|
||||
}
|
||||
|
||||
public func getAllSecureIdValues(network: Network, context: SecureIdAccessContext) -> Signal<[SecureIdValueWithContext], GetAllSecureIdValuesError> {
|
||||
return network.request(Api.functions.account.getAllSecureValues())
|
||||
|> mapError { _ -> GetAllSecureIdValuesError in
|
||||
return .generic
|
||||
}
|
||||
|> map { result -> [SecureIdValueWithContext] in
|
||||
var values: [SecureIdValueWithContext] = []
|
||||
for value in result {
|
||||
if let parsedValue = parseSecureValue(context: context, value: value, errors: []) {
|
||||
values.append(parsedValue.valueWithContext)
|
||||
}
|
||||
}
|
||||
return values
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user