mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Various fixes
This commit is contained in:
@@ -184,6 +184,7 @@ private struct PeerNameColorScreenState: Equatable {
|
||||
var updatedNameColor: PeerNameColor?
|
||||
var updatedBackgroundEmojiId: Int64?
|
||||
var inProgress: Bool = false
|
||||
var needsBoosts: Bool = false
|
||||
}
|
||||
|
||||
private func peerNameColorScreenEntries(
|
||||
@@ -253,7 +254,11 @@ private func peerNameColorScreenEntries(
|
||||
colors: nameColors,
|
||||
currentColor: nameColor
|
||||
))
|
||||
entries.append(.colorDescription(presentationData.strings.NameColor_ChatPreview_Description_Account))
|
||||
if case .channel = peer {
|
||||
entries.append(.colorDescription(presentationData.strings.NameColor_ChatPreview_Description_Channel))
|
||||
} else {
|
||||
entries.append(.colorDescription(presentationData.strings.NameColor_ChatPreview_Description_Account))
|
||||
}
|
||||
|
||||
if let emojiContent {
|
||||
entries.append(.backgroundEmojiHeader(presentationData.strings.NameColor_BackgroundEmoji_Title, backgroundEmojiId != nil ? presentationData.strings.NameColor_BackgroundEmoji_Remove : nil))
|
||||
@@ -561,6 +566,10 @@ public func PeerNameColorScreen(
|
||||
return true
|
||||
}
|
||||
let state = stateValue.with({ $0 })
|
||||
if case .channel = subject, state.needsBoosts {
|
||||
f()
|
||||
return true
|
||||
}
|
||||
var hasChanges = false
|
||||
if state.updatedNameColor != nil || state.updatedBackgroundEmojiId != nil {
|
||||
hasChanges = true
|
||||
@@ -624,6 +633,12 @@ public func PeerNameColorScreen(
|
||||
|> deliverOnMainQueue).startStandalone(next: {
|
||||
}, error: { error in
|
||||
if case .channelBoostRequired = error {
|
||||
updateState { state in
|
||||
var updatedState = state
|
||||
updatedState.needsBoosts = true
|
||||
return updatedState
|
||||
}
|
||||
|
||||
let _ = combineLatest(
|
||||
queue: Queue.mainQueue(),
|
||||
context.engine.data.get(TelegramEngine.EngineData.Item.Peer.Peer(id: peerId)),
|
||||
|
||||
Reference in New Issue
Block a user