mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Various improvements
This commit is contained in:
@@ -1370,15 +1370,21 @@ final class AvatarEditorScreenComponent: Component {
|
||||
}
|
||||
|
||||
private func presentPremiumToast() {
|
||||
guard let environment = self.environment, let component = self.component, let parentController = environment.controller() else {
|
||||
guard let environment = self.environment, let component = self.component, let state = self.state, let parentController = environment.controller() else {
|
||||
return
|
||||
}
|
||||
HapticFeedback().impact(.light)
|
||||
|
||||
var text: String = environment.strings.AvatarEditor_PremiumNeeded_Background
|
||||
if let selectedFile = state.selectedFile {
|
||||
if selectedFile.isSticker {
|
||||
text = environment.strings.AvatarEditor_PremiumNeeded_Sticker
|
||||
}
|
||||
}
|
||||
let controller = premiumAlertController(
|
||||
context: component.context,
|
||||
parentController: parentController,
|
||||
text: environment.strings.AvatarEditor_PremiumNeeded_Background
|
||||
text: text
|
||||
)
|
||||
parentController.present(controller, in: .window(.root))
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ final class BackgroundColorComponent: Component {
|
||||
background: values[i].0,
|
||||
isCustom: values[i].1,
|
||||
isSelected: component.selectedValue == values[i].0,
|
||||
isLocked: i >= 7 && !values[i].1,
|
||||
isLocked: i >= 7 && !values[i].1 && !component.isPremium,
|
||||
action: {
|
||||
if let value = values[i].0, component.selectedValue != value {
|
||||
component.updateValue(value)
|
||||
|
||||
Reference in New Issue
Block a user