Various fixes

This commit is contained in:
Ilya Laktyushin
2023-12-01 00:48:11 +04:00
parent 4f172c0519
commit a2f2411eaa
5 changed files with 20 additions and 7 deletions

View File

@@ -158,7 +158,7 @@ final class ThemeAccentColorController: ViewController {
if let strongSelf = self {
strongSelf.dismiss()
}
}, apply: { [weak self] state, serviceBackgroundColor in
}, apply: { [weak self] state, serviceBackgroundColor, forBoth in
if let strongSelf = self {
let context = strongSelf.context
let autoNightModeTriggered = strongSelf.presentationData.autoNightModeTriggered
@@ -175,7 +175,7 @@ final class ThemeAccentColorController: ViewController {
}
if case let .peer(peer) = strongSelf.resultMode {
let _ = strongSelf.context.engine.themes.setChatWallpaper(peerId: peer.id, wallpaper: coloredWallpaper, forBoth: false).start()
let _ = strongSelf.context.engine.themes.setChatWallpaper(peerId: peer.id, wallpaper: coloredWallpaper, forBoth: forBoth).start()
strongSelf.completion?()
return
}

View File

@@ -225,7 +225,7 @@ final class ThemeAccentColorControllerNode: ASDisplayNode, UIScrollViewDelegate
}
}
init(context: AccountContext, mode: ThemeAccentColorControllerMode, resultMode: ThemeAccentColorController.ResultMode, theme: PresentationTheme, wallpaper: TelegramWallpaper, dismiss: @escaping () -> Void, apply: @escaping (ThemeColorState, UIColor?) -> Void, ready: Promise<Bool>) {
init(context: AccountContext, mode: ThemeAccentColorControllerMode, resultMode: ThemeAccentColorController.ResultMode, theme: PresentationTheme, wallpaper: TelegramWallpaper, dismiss: @escaping () -> Void, apply: @escaping (ThemeColorState, UIColor?, Bool) -> Void, ready: Promise<Bool>) {
self.context = context
self.mode = mode
self.resultMode = resultMode
@@ -437,7 +437,7 @@ final class ThemeAccentColorControllerNode: ASDisplayNode, UIScrollViewDelegate
}
}
self.toolbarNode.done = { [weak self] _ in
self.toolbarNode.done = { [weak self] forBoth in
if let strongSelf = self {
if strongSelf.state.displayPatternPanel {
strongSelf.updateState({ current in
@@ -448,7 +448,7 @@ final class ThemeAccentColorControllerNode: ASDisplayNode, UIScrollViewDelegate
} else {
if !strongSelf.dismissed {
strongSelf.dismissed = true
apply(strongSelf.state, strongSelf.serviceBackgroundColor)
apply(strongSelf.state, strongSelf.serviceBackgroundColor, forBoth)
}
}
}