mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix crash
This commit is contained in:
parent
2178261bad
commit
f68632cb36
@ -819,41 +819,41 @@ private final class LimitSheetContent: CombinedComponent {
|
|||||||
reachedMaximumLimit = false
|
reachedMaximumLimit = false
|
||||||
}
|
}
|
||||||
|
|
||||||
let title = title.update(
|
|
||||||
component: MultilineTextComponent(
|
|
||||||
text: .plain(NSAttributedString(
|
|
||||||
string: titleText,
|
|
||||||
font: Font.semibold(17.0),
|
|
||||||
textColor: theme.actionSheet.primaryTextColor,
|
|
||||||
paragraphAlignment: .center
|
|
||||||
)),
|
|
||||||
horizontalAlignment: .center,
|
|
||||||
maximumNumberOfLines: 1
|
|
||||||
),
|
|
||||||
availableSize: CGSize(width: context.availableSize.width - sideInset * 2.0, height: CGFloat.greatestFiniteMagnitude),
|
|
||||||
transition: .immediate
|
|
||||||
)
|
|
||||||
|
|
||||||
let textFont = Font.regular(17.0)
|
|
||||||
let boldTextFont = Font.semibold(17.0)
|
|
||||||
let textColor = theme.actionSheet.primaryTextColor
|
|
||||||
let markdownAttributes = MarkdownAttributes(body: MarkdownAttributeSet(font: textFont, textColor: textColor), bold: MarkdownAttributeSet(font: boldTextFont, textColor: textColor), link: MarkdownAttributeSet(font: textFont, textColor: textColor), linkAttribute: { _ in
|
|
||||||
return nil
|
|
||||||
})
|
|
||||||
|
|
||||||
let text = text.update(
|
|
||||||
component: MultilineTextComponent(
|
|
||||||
text: .markdown(text: string, attributes: markdownAttributes),
|
|
||||||
horizontalAlignment: .center,
|
|
||||||
maximumNumberOfLines: 0,
|
|
||||||
lineSpacing: 0.0
|
|
||||||
),
|
|
||||||
availableSize: CGSize(width: context.availableSize.width - textSideInset * 2.0, height: context.availableSize.height),
|
|
||||||
transition: .immediate
|
|
||||||
)
|
|
||||||
|
|
||||||
let contentSize: CGSize
|
let contentSize: CGSize
|
||||||
if state.initialized {
|
if state.initialized {
|
||||||
|
let title = title.update(
|
||||||
|
component: MultilineTextComponent(
|
||||||
|
text: .plain(NSAttributedString(
|
||||||
|
string: titleText,
|
||||||
|
font: Font.semibold(17.0),
|
||||||
|
textColor: theme.actionSheet.primaryTextColor,
|
||||||
|
paragraphAlignment: .center
|
||||||
|
)),
|
||||||
|
horizontalAlignment: .center,
|
||||||
|
maximumNumberOfLines: 1
|
||||||
|
),
|
||||||
|
availableSize: CGSize(width: context.availableSize.width - sideInset * 2.0, height: CGFloat.greatestFiniteMagnitude),
|
||||||
|
transition: .immediate
|
||||||
|
)
|
||||||
|
|
||||||
|
let textFont = Font.regular(17.0)
|
||||||
|
let boldTextFont = Font.semibold(17.0)
|
||||||
|
let textColor = theme.actionSheet.primaryTextColor
|
||||||
|
let markdownAttributes = MarkdownAttributes(body: MarkdownAttributeSet(font: textFont, textColor: textColor), bold: MarkdownAttributeSet(font: boldTextFont, textColor: textColor), link: MarkdownAttributeSet(font: textFont, textColor: textColor), linkAttribute: { _ in
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
|
||||||
|
let text = text.update(
|
||||||
|
component: MultilineTextComponent(
|
||||||
|
text: .markdown(text: string, attributes: markdownAttributes),
|
||||||
|
horizontalAlignment: .center,
|
||||||
|
maximumNumberOfLines: 0,
|
||||||
|
lineSpacing: 0.0
|
||||||
|
),
|
||||||
|
availableSize: CGSize(width: context.availableSize.width - textSideInset * 2.0, height: context.availableSize.height),
|
||||||
|
transition: .immediate
|
||||||
|
)
|
||||||
|
|
||||||
let gradientColors: [UIColor]
|
let gradientColors: [UIColor]
|
||||||
if isPremiumDisabled {
|
if isPremiumDisabled {
|
||||||
gradientColors = [
|
gradientColors = [
|
||||||
|
@ -128,10 +128,10 @@ public final class SolidRoundedButtonNode: ASDisplayNode {
|
|||||||
if self.gloss {
|
if self.gloss {
|
||||||
self.animationTimer?.invalidate()
|
self.animationTimer?.invalidate()
|
||||||
|
|
||||||
Queue.mainQueue().after(0.75) {
|
Queue.mainQueue().after(1.25) {
|
||||||
self.animationNode?.play()
|
self.animationNode?.play()
|
||||||
|
|
||||||
let timer = SwiftSignalKit.Timer(timeout: 3.0, repeat: true, completion: { [weak self] in
|
let timer = SwiftSignalKit.Timer(timeout: 4.0, repeat: true, completion: { [weak self] in
|
||||||
self?.animationNode?.play()
|
self?.animationNode?.play()
|
||||||
}, queue: Queue.mainQueue())
|
}, queue: Queue.mainQueue())
|
||||||
self.animationTimer = timer
|
self.animationTimer = timer
|
||||||
@ -672,10 +672,10 @@ public final class SolidRoundedButtonView: UIView {
|
|||||||
if self.gloss {
|
if self.gloss {
|
||||||
self.animationTimer?.invalidate()
|
self.animationTimer?.invalidate()
|
||||||
|
|
||||||
Queue.mainQueue().after(0.75) {
|
Queue.mainQueue().after(1.25) {
|
||||||
self.animationNode?.play()
|
self.animationNode?.play()
|
||||||
|
|
||||||
let timer = SwiftSignalKit.Timer(timeout: 3.0, repeat: true, completion: { [weak self] in
|
let timer = SwiftSignalKit.Timer(timeout: 4.0, repeat: true, completion: { [weak self] in
|
||||||
self?.animationNode?.play()
|
self?.animationNode?.play()
|
||||||
}, queue: Queue.mainQueue())
|
}, queue: Queue.mainQueue())
|
||||||
self.animationTimer = timer
|
self.animationTimer = timer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user