diff --git a/submodules/SettingsUI/Sources/Language Selection/LocalizationListControllerNode.swift b/submodules/SettingsUI/Sources/Language Selection/LocalizationListControllerNode.swift index 81d14a4568..78a228ed3c 100644 --- a/submodules/SettingsUI/Sources/Language Selection/LocalizationListControllerNode.swift +++ b/submodules/SettingsUI/Sources/Language Selection/LocalizationListControllerNode.swift @@ -723,8 +723,10 @@ final class LocalizationListControllerNode: ViewControllerTracingNode { } strongSelf.applyingCode.set(.single(info.languageCode)) strongSelf.applyDisposable.set((strongSelf.context.engine.localization.downloadAndApplyLocalization(accountManager: strongSelf.context.sharedContext.accountManager, languageCode: info.languageCode) - |> deliverOnMainQueue).start(completed: { + |> deliverOnMainQueue).start(completed: { [weak self] in self?.applyingCode.set(.single(nil)) + + self?.context.engine.messages.refreshAttachMenuBots() })) } if info.isOfficial { diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/TelegramEngineMessages.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/TelegramEngineMessages.swift index 18aca8e45a..9764d49673 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/TelegramEngineMessages.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/TelegramEngineMessages.swift @@ -522,6 +522,10 @@ public extension TelegramEngine { public func invokeBotCustomMethod(botId: PeerId, method: String, params: String) -> Signal { return _internal_invokeBotCustomMethod(postbox: self.account.postbox, network: self.account.network, botId: botId, method: method, params: params) } + + public func refreshAttachMenuBots() { + let _ = managedSynchronizeAttachMenuBots(accountPeerId: self.account.peerId, postbox: self.account.postbox, network: self.account.network, force: true).startStandalone() + } public func addBotToAttachMenu(botId: PeerId, allowWrite: Bool) -> Signal { return _internal_addBotToAttachMenu(accountPeerId: self.account.peerId, postbox: self.account.postbox, network: self.account.network, botId: botId, allowWrite: allowWrite) diff --git a/submodules/TelegramUI/Sources/PeerInfo/ListItems/PeerInfoScreenDisclosureItem.swift b/submodules/TelegramUI/Sources/PeerInfo/ListItems/PeerInfoScreenDisclosureItem.swift index 39d6437e45..44927d8312 100644 --- a/submodules/TelegramUI/Sources/PeerInfo/ListItems/PeerInfoScreenDisclosureItem.swift +++ b/submodules/TelegramUI/Sources/PeerInfo/ListItems/PeerInfoScreenDisclosureItem.swift @@ -60,7 +60,7 @@ private final class PeerInfoScreenDisclosureItemNode: PeerInfoScreenItemNode { private let bottomSeparatorNode: ASDisplayNode private let activateArea: AccessibilityAreaNode - private var iconDisposable: Disposable? + private var iconDisposable = MetaDisposable() private var item: PeerInfoScreenDisclosureItem? @@ -115,7 +115,7 @@ private final class PeerInfoScreenDisclosureItemNode: PeerInfoScreenItemNode { } deinit { - self.iconDisposable?.dispose() + self.iconDisposable.dispose() } override func update(width: CGFloat, safeInsets: UIEdgeInsets, presentationData: PresentationData, item: PeerInfoScreenItem, topItem: PeerInfoScreenItem?, bottomItem: PeerInfoScreenItem?, hasCorners: Bool, transition: ContainedViewLayoutTransition) -> CGFloat { @@ -169,12 +169,12 @@ private final class PeerInfoScreenDisclosureItemNode: PeerInfoScreenItemNode { } else if let iconSignal = item.iconSignal { if previousItem?.text != item.text { self.iconNode.image = nil - self.iconDisposable = (iconSignal + self.iconDisposable.set((iconSignal |> deliverOnMainQueue).startStrict(next: { [weak self] icon in if let self { self.iconNode.image = icon } - }) + })) } iconSize = CGSize(width: 29.0, height: 29.0) } else {