mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Fix more warnings
This commit is contained in:
@@ -129,7 +129,7 @@ private enum TwoStepVerificationUnlockSettingsEntry: ItemListNodeEntry {
|
||||
func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem {
|
||||
let arguments = arguments as! TwoStepVerificationUnlockSettingsControllerArguments
|
||||
switch self {
|
||||
case let .passwordEntry(theme, strings, text, value):
|
||||
case let .passwordEntry(theme, _, text, value):
|
||||
return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(string: text, textColor: theme.list.itemPrimaryTextColor), text: value, placeholder: "", type: .password, spacing: 10.0, tag: TwoStepVerificationUnlockSettingsEntryTag.password, sectionId: self.section, textUpdated: { updatedText in
|
||||
arguments.updatePasswordText(updatedText)
|
||||
}, action: {
|
||||
@@ -377,8 +377,8 @@ public func twoStepVerificationUnlockSettingsController(context: AccountContext,
|
||||
switch data {
|
||||
case .access:
|
||||
dataPromise.set(.single(TwoStepVerificationUnlockSettingsControllerData.access(configuration: .notSet(pendingEmail: nil))))
|
||||
case let .manage(manage):
|
||||
dataPromise.set(.single(TwoStepVerificationUnlockSettingsControllerData.manage(password: manage.password, emailSet: false, pendingEmail: nil, hasSecureValues: manage.hasSecureValues)))
|
||||
case let .manage(password, _, _, hasSecureValues):
|
||||
dataPromise.set(.single(TwoStepVerificationUnlockSettingsControllerData.manage(password: password, emailSet: false, pendingEmail: nil, hasSecureValues: hasSecureValues)))
|
||||
}
|
||||
|
||||
updateState { state in
|
||||
@@ -406,8 +406,8 @@ public func twoStepVerificationUnlockSettingsController(context: AccountContext,
|
||||
dataPromise.set(.single(.access(configuration: nil))
|
||||
|> then(context.engine.auth.twoStepVerificationConfiguration() |> map { TwoStepVerificationUnlockSettingsControllerData.access(configuration: TwoStepVerificationAccessConfiguration(configuration: $0, password: pendingEmail.password)) }))
|
||||
}
|
||||
case let .manage(manage):
|
||||
dataPromise.set(.single(TwoStepVerificationUnlockSettingsControllerData.manage(password: manage.password, emailSet: true, pendingEmail: nil, hasSecureValues: manage.hasSecureValues)))
|
||||
case let .manage(password, _, _, hasSecureValues):
|
||||
dataPromise.set(.single(TwoStepVerificationUnlockSettingsControllerData.manage(password: password, emailSet: true, pendingEmail: nil, hasSecureValues: hasSecureValues)))
|
||||
}
|
||||
|
||||
updateState { state in
|
||||
@@ -448,8 +448,8 @@ public func twoStepVerificationUnlockSettingsController(context: AccountContext,
|
||||
}
|
||||
|> map { configuration in
|
||||
var pendingEmail: TwoStepVerificationPendingEmail?
|
||||
if case let .set(configuration) = configuration {
|
||||
pendingEmail = configuration.pendingEmail
|
||||
if case let .set(_, _, pendingEmailValue, _, _) = configuration {
|
||||
pendingEmail = pendingEmailValue
|
||||
}
|
||||
return (settings, pendingEmail)
|
||||
}
|
||||
@@ -646,7 +646,7 @@ public func twoStepVerificationUnlockSettingsController(context: AccountContext,
|
||||
break
|
||||
}
|
||||
}
|
||||
case let .manage(password, hasRecovery, pendingEmail, hasSecureValues):
|
||||
case let .manage(password, hasRecovery, _, hasSecureValues):
|
||||
let controller = SetupTwoStepVerificationController(context: context, initialState: .updatePassword(current: password, hasRecoveryEmail: hasRecovery, hasSecureValues: hasSecureValues), stateUpdated: { update, shouldDismiss, controller in
|
||||
switch update {
|
||||
case .pendingPasswordReset:
|
||||
@@ -697,7 +697,7 @@ public func twoStepVerificationUnlockSettingsController(context: AccountContext,
|
||||
if disablePassword {
|
||||
setupDisposable.set((dataPromise.get()
|
||||
|> take(1)
|
||||
|> mapError { _ -> UpdateTwoStepVerificationPasswordError in return .generic }
|
||||
|> mapError { _ -> UpdateTwoStepVerificationPasswordError in }
|
||||
|> mapToSignal { data -> Signal<Void, UpdateTwoStepVerificationPasswordError> in
|
||||
switch data {
|
||||
case .access:
|
||||
@@ -953,12 +953,12 @@ public func twoStepVerificationUnlockSettingsController(context: AccountContext,
|
||||
} else {
|
||||
emptyStateItem = ItemListLoadingIndicatorEmptyStateItem(theme: presentationData.theme)
|
||||
}
|
||||
case let .manage(manage):
|
||||
case let .manage(_, _, pendingEmail, _):
|
||||
title = presentationData.strings.PrivacySettings_TwoStepAuth
|
||||
if state.checking {
|
||||
rightNavigationButton = ItemListNavigationButton(content: .none, style: .activity, enabled: true, action: {})
|
||||
} else {
|
||||
if let _ = manage.pendingEmail {
|
||||
if let _ = pendingEmail {
|
||||
rightNavigationButton = ItemListNavigationButton(content: .text(presentationData.strings.Common_Next), style: .bold, enabled: !state.emailCode.isEmpty, action: {
|
||||
checkEmailConfirmation()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user