mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix several possible crashes.
This commit is contained in:
parent
f53b64bc72
commit
e4ca8ae847
3 changed files with 22 additions and 6 deletions
|
@ -522,9 +522,23 @@ not_null<Ui::SlideWrap<>*> Controller::addRequestedListBlock(
|
||||||
lt_count_decimal,
|
lt_count_decimal,
|
||||||
std::move(requestedCount)));
|
std::move(requestedCount)));
|
||||||
|
|
||||||
const auto delegate = container->lifetime().make_state<
|
class Delegate final : public PeerListContentDelegateSimple {
|
||||||
PeerListContentDelegateSimple
|
public:
|
||||||
>();
|
explicit Delegate(std::shared_ptr<Main::SessionShow> show)
|
||||||
|
: _show(std::move(show)) {
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<Main::SessionShow> peerListUiShow() override {
|
||||||
|
return _show;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
const std::shared_ptr<Main::SessionShow> _show;
|
||||||
|
|
||||||
|
};
|
||||||
|
const auto delegate = container->lifetime().make_state<Delegate>(
|
||||||
|
this->delegate()->peerListUiShow());
|
||||||
|
|
||||||
const auto controller = container->lifetime().make_state<
|
const auto controller = container->lifetime().make_state<
|
||||||
Controller
|
Controller
|
||||||
>(_peer, _data.current().admin, _data.value(), Role::Requested);
|
>(_peer, _data.current().admin, _data.value(), Role::Requested);
|
||||||
|
|
|
@ -936,16 +936,18 @@ void ShareBox::Inner::loadProfilePhotos() {
|
||||||
const auto from = std::max(yFrom / _rowHeight, 0);
|
const auto from = std::max(yFrom / _rowHeight, 0);
|
||||||
const auto to = std::max((yTo / _rowHeight) + 1, from);
|
const auto to = std::max((yTo / _rowHeight) + 1, from);
|
||||||
|
|
||||||
const auto ffrom = from;
|
|
||||||
const auto fto = std::min(to, int(_filtered.size()));
|
const auto fto = std::min(to, int(_filtered.size()));
|
||||||
|
const auto ffrom = std::min(from, fto);
|
||||||
for (auto i = ffrom; i != fto; ++i) {
|
for (auto i = ffrom; i != fto; ++i) {
|
||||||
preloadUserpic(_filtered[i]->entry());
|
preloadUserpic(_filtered[i]->entry());
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto ufrom = std::max(from - int(_filtered.size()), 0);
|
|
||||||
const auto uto = std::min(
|
const auto uto = std::min(
|
||||||
to - int(_filtered.size()),
|
to - int(_filtered.size()),
|
||||||
int(d_byUsernameFiltered.size()));
|
int(d_byUsernameFiltered.size()));
|
||||||
|
const auto ufrom = std::min(
|
||||||
|
std::max(from - int(_filtered.size()), 0),
|
||||||
|
uto);
|
||||||
for (auto i = ufrom; i != uto; ++i) {
|
for (auto i = ufrom; i != uto; ++i) {
|
||||||
preloadUserpic(d_byUsernameFiltered[i]->history);
|
preloadUserpic(d_byUsernameFiltered[i]->history);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 30b22ace0b67f72e2ab913fccf56842b863effad
|
Subproject commit a2c2d92cda2cffdafeb671d1f292a2002fb54217
|
Loading…
Add table
Reference in a new issue