mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various fixes
This commit is contained in:
parent
d6923ba451
commit
14fc46a196
@ -9752,3 +9752,5 @@ Sorry for the inconvenience.";
|
|||||||
|
|
||||||
"StoryList.TooltipStoriesSavedToProfile_1" = "Story archived";
|
"StoryList.TooltipStoriesSavedToProfile_1" = "Story archived";
|
||||||
"StoryList.TooltipStoriesSavedToProfile_any" = "%d stories archived.";
|
"StoryList.TooltipStoriesSavedToProfile_any" = "%d stories archived.";
|
||||||
|
|
||||||
|
"Premium.New" = "NEW";
|
||||||
|
@ -1738,7 +1738,8 @@ private final class PremiumIntroScreenContentComponent: CombinedComponent {
|
|||||||
subtitle: perk.subtitle(strings: strings),
|
subtitle: perk.subtitle(strings: strings),
|
||||||
subtitleColor: subtitleColor,
|
subtitleColor: subtitleColor,
|
||||||
arrowColor: arrowColor,
|
arrowColor: arrowColor,
|
||||||
accentColor: accentColor
|
accentColor: accentColor,
|
||||||
|
badge: perk.identifier == "stories" ? strings.Premium_New : nil
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
@ -413,7 +413,7 @@ final class MediaEditorScreenComponent: Component {
|
|||||||
if let view = self.inputPanel.view as? MessageInputPanelComponent.View {
|
if let view = self.inputPanel.view as? MessageInputPanelComponent.View {
|
||||||
self.nextTransitionUserData = TextFieldComponent.AnimationHint(kind: .textFocusChanged)
|
self.nextTransitionUserData = TextFieldComponent.AnimationHint(kind: .textFocusChanged)
|
||||||
if view.isActive {
|
if view.isActive {
|
||||||
view.deactivateInput()
|
view.deactivateInput(force: true)
|
||||||
} else {
|
} else {
|
||||||
self.endEditing(true)
|
self.endEditing(true)
|
||||||
}
|
}
|
||||||
@ -743,6 +743,9 @@ final class MediaEditorScreenComponent: Component {
|
|||||||
guard let controller = environment.controller() as? MediaEditorScreen else {
|
guard let controller = environment.controller() as? MediaEditorScreen else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
guard controller.checkCaptionLimit() else {
|
||||||
|
return
|
||||||
|
}
|
||||||
if controller.isEditingStory {
|
if controller.isEditingStory {
|
||||||
controller.requestCompletion(animated: true)
|
controller.requestCompletion(animated: true)
|
||||||
} else {
|
} else {
|
||||||
@ -1197,9 +1200,11 @@ final class MediaEditorScreenComponent: Component {
|
|||||||
self.deactivateInput()
|
self.deactivateInput()
|
||||||
}
|
}
|
||||||
case .text:
|
case .text:
|
||||||
let text = self.getInputText()
|
Queue.mainQueue().after(0.1) {
|
||||||
if text.length > component.context.userLimits.maxStoryCaptionLength {
|
let text = self.getInputText()
|
||||||
controller.presentCaptionLimitPremiumSuggestion(isPremium: self.state?.isPremium ?? false)
|
if text.length > component.context.userLimits.maxStoryCaptionLength {
|
||||||
|
controller.presentCaptionLimitPremiumSuggestion(isPremium: self.state?.isPremium ?? false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
@ -3892,6 +3897,20 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fileprivate func checkCaptionLimit() -> Bool {
|
||||||
|
let caption = self.getCaption()
|
||||||
|
if caption.length > self.context.userLimits.maxStoryCaptionLength {
|
||||||
|
let _ = (self.context.engine.data.get(TelegramEngine.EngineData.Item.Peer.Peer(id: self.context.account.peerId))
|
||||||
|
|> deliverOnMainQueue).start(next: { [weak self] peer in
|
||||||
|
if let self {
|
||||||
|
self.presentCaptionLimitPremiumSuggestion(isPremium: peer?.isPremium ?? false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
private var didComplete = false
|
private var didComplete = false
|
||||||
func requestCompletion(animated: Bool) {
|
func requestCompletion(animated: Bool) {
|
||||||
@ -4346,11 +4365,17 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate
|
|||||||
if let controller = controller as? TooltipScreen {
|
if let controller = controller as? TooltipScreen {
|
||||||
controller.dismiss()
|
controller.dismiss()
|
||||||
}
|
}
|
||||||
|
if let controller = controller as? UndoOverlayController {
|
||||||
|
controller.dismiss()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
self.forEachController({ controller in
|
self.forEachController({ controller in
|
||||||
if let controller = controller as? TooltipScreen {
|
if let controller = controller as? TooltipScreen {
|
||||||
controller.dismiss()
|
controller.dismiss()
|
||||||
}
|
}
|
||||||
|
if let controller = controller as? UndoOverlayController {
|
||||||
|
controller.dismiss()
|
||||||
|
}
|
||||||
if let controller = controller as? SaveProgressScreen {
|
if let controller = controller as? SaveProgressScreen {
|
||||||
controller.dismiss()
|
controller.dismiss()
|
||||||
}
|
}
|
||||||
|
@ -462,8 +462,8 @@ public final class MessageInputPanelComponent: Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func deactivateInput() {
|
public func deactivateInput(force: Bool = false) {
|
||||||
if self.canDeactivateInput() {
|
if self.canDeactivateInput() || force {
|
||||||
if let textFieldView = self.textField.view as? TextFieldComponent.View {
|
if let textFieldView = self.textField.view as? TextFieldComponent.View {
|
||||||
textFieldView.deactivateInput()
|
textFieldView.deactivateInput()
|
||||||
}
|
}
|
||||||
|
@ -300,6 +300,7 @@ public final class TextFieldComponent: Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.state?.updated(transition: Transition(animation: .curve(duration: 0.4, curve: .spring)).withUserData(AnimationHint(kind: .textChanged)))
|
self.state?.updated(transition: Transition(animation: .curve(duration: 0.4, curve: .spring)).withUserData(AnimationHint(kind: .textChanged)))
|
||||||
|
component.paste(.text)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user