mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-29 11:25:38 +00:00
Don't display QR login intro when QR auth is not available
This commit is contained in:
parent
8f1dafed6e
commit
8c7c74e37c
@ -819,6 +819,8 @@ public func settingsController(context: AccountContext, accountManager: AccountM
|
|||||||
accountsAndPeers.set(activeAccountsAndPeers(context: context))
|
accountsAndPeers.set(activeAccountsAndPeers(context: context))
|
||||||
|
|
||||||
let privacySettings = Promise<AccountPrivacySettings?>(nil)
|
let privacySettings = Promise<AccountPrivacySettings?>(nil)
|
||||||
|
|
||||||
|
let enableQRLogin = Promise<Bool>()
|
||||||
|
|
||||||
let openFaq: (Promise<ResolvedUrl>, String?) -> Void = { resolvedUrl, customAnchor in
|
let openFaq: (Promise<ResolvedUrl>, String?) -> Void = { resolvedUrl, customAnchor in
|
||||||
let _ = (contextValue.get()
|
let _ = (contextValue.get()
|
||||||
@ -1105,10 +1107,13 @@ public func settingsController(context: AccountContext, accountManager: AccountM
|
|||||||
gesture?.cancel()
|
gesture?.cancel()
|
||||||
}
|
}
|
||||||
}, openDevices: {
|
}, openDevices: {
|
||||||
let _ = (activeSessionsContextAndCount.get()
|
let _ = (combineLatest(queue: .mainQueue(),
|
||||||
|> deliverOnMainQueue
|
activeSessionsContextAndCount.get(),
|
||||||
|> take(1)).start(next: { activeSessionsContext, count, webSessionsContext in
|
enableQRLogin.get()
|
||||||
if count == 0 {
|
)
|
||||||
|
|> take(1)).start(next: { activeSessionsContextAndCount, enableQRLogin in
|
||||||
|
let (activeSessionsContext, count, webSessionsContext) = activeSessionsContextAndCount
|
||||||
|
if count == 0 && enableQRLogin {
|
||||||
pushControllerImpl?(AuthDataTransferSplashScreen(context: context, activeSessionsContext: activeSessionsContext))
|
pushControllerImpl?(AuthDataTransferSplashScreen(context: context, activeSessionsContext: activeSessionsContext))
|
||||||
} else {
|
} else {
|
||||||
pushControllerImpl?(recentSessionsController(context: context, activeSessionsContext: activeSessionsContext, webSessionsContext: webSessionsContext, websitesOnly: false))
|
pushControllerImpl?(recentSessionsController(context: context, activeSessionsContext: activeSessionsContext, webSessionsContext: webSessionsContext, websitesOnly: false))
|
||||||
@ -1358,7 +1363,7 @@ public func settingsController(context: AccountContext, accountManager: AccountM
|
|||||||
return context.account.viewTracker.featuredStickerPacks()
|
return context.account.viewTracker.featuredStickerPacks()
|
||||||
}
|
}
|
||||||
|
|
||||||
let enableQRLogin = contextValue.get()
|
let enableQRLoginSignal = contextValue.get()
|
||||||
|> mapToSignal { context -> Signal<Bool, NoError> in
|
|> mapToSignal { context -> Signal<Bool, NoError> in
|
||||||
return context.account.postbox.preferencesView(keys: [PreferencesKeys.appConfiguration])
|
return context.account.postbox.preferencesView(keys: [PreferencesKeys.appConfiguration])
|
||||||
|> map { view -> Bool in
|
|> map { view -> Bool in
|
||||||
@ -1372,8 +1377,9 @@ public func settingsController(context: AccountContext, accountManager: AccountM
|
|||||||
}
|
}
|
||||||
|> distinctUntilChanged
|
|> distinctUntilChanged
|
||||||
}
|
}
|
||||||
|
enableQRLogin.set(enableQRLoginSignal)
|
||||||
|
|
||||||
let signal = combineLatest(queue: Queue.mainQueue(), contextValue.get(), updatedPresentationData, statePromise.get(), peerView, combineLatest(queue: Queue.mainQueue(), preferences, notifyExceptions.get(), notificationsAuthorizationStatus.get(), notificationsWarningSuppressed.get(), privacySettings.get(), displayPhoneNumberConfirmation.get()), combineLatest(featuredStickerPacks, archivedPacks.get()), combineLatest(hasWallet, hasPassport.get(), hasWatchApp, enableQRLogin), accountsAndPeers.get(), activeSessionsContextAndCount.get())
|
let signal = combineLatest(queue: Queue.mainQueue(), contextValue.get(), updatedPresentationData, statePromise.get(), peerView, combineLatest(queue: Queue.mainQueue(), preferences, notifyExceptions.get(), notificationsAuthorizationStatus.get(), notificationsWarningSuppressed.get(), privacySettings.get(), displayPhoneNumberConfirmation.get()), combineLatest(featuredStickerPacks, archivedPacks.get()), combineLatest(hasWallet, hasPassport.get(), hasWatchApp, enableQRLogin.get()), accountsAndPeers.get(), activeSessionsContextAndCount.get())
|
||||||
|> map { context, presentationData, state, view, preferencesAndExceptions, featuredAndArchived, hasWalletPassportAndWatch, accountsAndPeers, activeSessionsContextAndCount -> (ItemListControllerState, (ItemListNodeState, Any)) in
|
|> map { context, presentationData, state, view, preferencesAndExceptions, featuredAndArchived, hasWalletPassportAndWatch, accountsAndPeers, activeSessionsContextAndCount -> (ItemListControllerState, (ItemListNodeState, Any)) in
|
||||||
let otherSessionCount = activeSessionsContextAndCount.1
|
let otherSessionCount = activeSessionsContextAndCount.1
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user