Fix possible crash with custom wallpapered peers.

This commit is contained in:
John Preston 2024-05-01 14:37:52 +04:00
parent a62d1dfa63
commit 7e071c770f
2 changed files with 5 additions and 3 deletions

View File

@ -201,10 +201,12 @@ rpl::producer<const Data::WallPaper*> WallPaperResolved(
return result;
}
themes->refreshChatThemes();
return themes->chatThemesUpdated(
return rpl::single<const Data::WallPaper*>(
nullptr
) | rpl::then(themes->chatThemesUpdated(
) | rpl::take(1) | rpl::map([=] {
return fromThemes(true);
}) | rpl::flatten_latest();
}) | rpl::flatten_latest());
}
AbstractSectionWidget::AbstractSectionWidget(

View File

@ -700,7 +700,7 @@ private:
rpl::event_stream<> _filtersMenuChanged;
std::shared_ptr<Ui::ChatTheme> _defaultChatTheme;
const std::shared_ptr<Ui::ChatTheme> _defaultChatTheme;
base::flat_map<CachedThemeKey, CachedTheme> _customChatThemes;
rpl::event_stream<std::shared_ptr<Ui::ChatTheme>> _cachedThemesStream;
const std::unique_ptr<Ui::ChatStyle> _chatStyle;