Various Fixes

This commit is contained in:
Ilya Laktyushin 2021-06-17 03:12:15 +03:00
parent 562265997d
commit cd75f7e364
5 changed files with 13 additions and 3 deletions

View File

@ -6515,3 +6515,8 @@ Sorry for the inconvenience.";
"Conversation.InputMenu" = "Menu"; "Conversation.InputMenu" = "Menu";
"Conversation.MessageDoesntExist" = "Message doesn't exist"; "Conversation.MessageDoesntExist" = "Message doesn't exist";
"Settings.CheckPasswordTitle" = "Is %@ still your number?";
"Settings.CheckPasswordText" = "Your account is protected by 2-Step Verification. Do you still remember your password?";
"Settings.KeepPassword" = "Yes, definitely";
"Settings.TryEnterPassword" = "Not sure, let me try";

View File

@ -170,10 +170,10 @@ public final class ShareInputFieldNode: ASDisplayNode, ASEditableTextNodeDelegat
@objc public func editableTextNodeDidUpdateText(_ editableTextNode: ASEditableTextNode) { @objc public func editableTextNodeDidUpdateText(_ editableTextNode: ASEditableTextNode) {
self.updateTextNodeText(animated: true) self.updateTextNodeText(animated: true)
self.updateText?(editableTextNode.attributedText?.string ?? "") self.updateText?(editableTextNode.attributedText?.string ?? "")
self.placeholderNode.isHidden = !(editableTextNode.textView.text ?? "").isEmpty
} }
public func editableTextNodeDidBeginEditing(_ editableTextNode: ASEditableTextNode) { public func editableTextNodeDidBeginEditing(_ editableTextNode: ASEditableTextNode) {
self.placeholderNode.isHidden = true
self.clearButton.isHidden = false self.clearButton.isHidden = false
if self.selectTextOnce { if self.selectTextOnce {

View File

@ -481,7 +481,7 @@ func openResolvedUrlImpl(_ resolvedUrl: ResolvedUrl, context: AccountContext, ur
} }
case .importStickers: case .importStickers:
dismissInput() dismissInput()
if let navigationController = navigationController, let data = UIPasteboard.general.data(forPasteboardType: "org.telegram.third-party.stickerpack"), let stickerPack = ImportStickerPack(data: data), !stickerPack.stickers.isEmpty { if let navigationController = navigationController, let data = UIPasteboard.general.data(forPasteboardType: "org.telegram.third-party.stickerset"), let stickerPack = ImportStickerPack(data: data), !stickerPack.stickers.isEmpty {
for controller in navigationController.overlayControllers { for controller in navigationController.overlayControllers {
if controller is ImportStickerPackController { if controller is ImportStickerPackController {
controller.dismiss() controller.dismiss()

View File

@ -112,6 +112,7 @@ final class PeerInfoState {
final class TelegramGlobalSettings { final class TelegramGlobalSettings {
let suggestPhoneNumberConfirmation: Bool let suggestPhoneNumberConfirmation: Bool
let suggestPasswordConfirmation: Bool
let accountsAndPeers: [(Account, Peer, Int32)] let accountsAndPeers: [(Account, Peer, Int32)]
let activeSessionsContext: ActiveSessionsContext? let activeSessionsContext: ActiveSessionsContext?
let webSessionsContext: WebSessionsContext? let webSessionsContext: WebSessionsContext?
@ -130,6 +131,7 @@ final class TelegramGlobalSettings {
init( init(
suggestPhoneNumberConfirmation: Bool, suggestPhoneNumberConfirmation: Bool,
suggestPasswordConfirmation: Bool,
accountsAndPeers: [(Account, Peer, Int32)], accountsAndPeers: [(Account, Peer, Int32)],
activeSessionsContext: ActiveSessionsContext?, activeSessionsContext: ActiveSessionsContext?,
webSessionsContext: WebSessionsContext?, webSessionsContext: WebSessionsContext?,
@ -147,6 +149,7 @@ final class TelegramGlobalSettings {
enableQRLogin: Bool enableQRLogin: Bool
) { ) {
self.suggestPhoneNumberConfirmation = suggestPhoneNumberConfirmation self.suggestPhoneNumberConfirmation = suggestPhoneNumberConfirmation
self.suggestPasswordConfirmation = suggestPasswordConfirmation
self.accountsAndPeers = accountsAndPeers self.accountsAndPeers = accountsAndPeers
self.activeSessionsContext = activeSessionsContext self.activeSessionsContext = activeSessionsContext
self.webSessionsContext = webSessionsContext self.webSessionsContext = webSessionsContext
@ -417,7 +420,7 @@ func peerInfoScreenSettingsData(context: AccountContext, peerId: PeerId, account
enableQRLogin = true enableQRLogin = true
} }
let globalSettings = TelegramGlobalSettings(suggestPhoneNumberConfirmation: suggestions.contains(.validatePhoneNumber), accountsAndPeers: accountsAndPeers, activeSessionsContext: accountSessions?.0, webSessionsContext: accountSessions?.2, otherSessionsCount: accountSessions?.1, proxySettings: proxySettings, notificationAuthorizationStatus: notificationsAuthorizationStatus, notificationWarningSuppressed: notificationsWarningSuppressed, notificationExceptions: notificationExceptions, inAppNotificationSettings: inAppNotificationSettings, privacySettings: privacySettings, unreadTrendingStickerPacks: unreadTrendingStickerPacks, archivedStickerPacks: archivedStickerPacks, hasPassport: hasPassport, hasWatchApp: hasWatchApp, enableQRLogin: enableQRLogin) let globalSettings = TelegramGlobalSettings(suggestPhoneNumberConfirmation: suggestions.contains(.validatePhoneNumber), suggestPasswordConfirmation: suggestions.contains(.validatePassword), accountsAndPeers: accountsAndPeers, activeSessionsContext: accountSessions?.0, webSessionsContext: accountSessions?.2, otherSessionsCount: accountSessions?.1, proxySettings: proxySettings, notificationAuthorizationStatus: notificationsAuthorizationStatus, notificationWarningSuppressed: notificationsWarningSuppressed, notificationExceptions: notificationExceptions, inAppNotificationSettings: inAppNotificationSettings, privacySettings: privacySettings, unreadTrendingStickerPacks: unreadTrendingStickerPacks, archivedStickerPacks: archivedStickerPacks, hasPassport: hasPassport, hasWatchApp: hasWatchApp, enableQRLogin: enableQRLogin)
return PeerInfoScreenData( return PeerInfoScreenData(
peer: peerView.peers[peerId], peer: peerView.peers[peerId],

View File

@ -707,6 +707,8 @@ private func settingsItems(data: PeerInfoScreenData?, context: AccountContext, p
items[.phone]!.append(PeerInfoScreenActionItem(id: 2, text: presentationData.strings.Settings_ChangePhoneNumber, action: { items[.phone]!.append(PeerInfoScreenActionItem(id: 2, text: presentationData.strings.Settings_ChangePhoneNumber, action: {
interaction.openSettings(.phoneNumber) interaction.openSettings(.phoneNumber)
})) }))
} else if settings.suggestPasswordConfirmation {
} }
if !settings.accountsAndPeers.isEmpty { if !settings.accountsAndPeers.isEmpty {