mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-03 16:15:13 +00:00
@@ -2030,7 +2030,6 @@ void HistoryWidget::showHistory(
|
|||||||
_membersDropdown.destroy();
|
_membersDropdown.destroy();
|
||||||
_scrollToAnimation.stop();
|
_scrollToAnimation.stop();
|
||||||
|
|
||||||
clearAllLoadRequests();
|
|
||||||
setHistory(nullptr);
|
setHistory(nullptr);
|
||||||
_list = nullptr;
|
_list = nullptr;
|
||||||
_peer = nullptr;
|
_peer = nullptr;
|
||||||
@@ -2241,10 +2240,6 @@ void HistoryWidget::setHistory(History *history) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto wasHistory = base::take(_history);
|
|
||||||
const auto wasMigrated = base::take(_migrated);
|
|
||||||
|
|
||||||
// Unload lottie animations.
|
|
||||||
const auto unloadHeavyViewParts = [](History *history) {
|
const auto unloadHeavyViewParts = [](History *history) {
|
||||||
if (history) {
|
if (history) {
|
||||||
history->owner().unloadHeavyViewParts(
|
history->owner().unloadHeavyViewParts(
|
||||||
@@ -2252,13 +2247,19 @@ void HistoryWidget::setHistory(History *history) {
|
|||||||
history->forceFullResize();
|
history->forceFullResize();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
unloadHeavyViewParts(wasHistory);
|
if (_history) {
|
||||||
unloadHeavyViewParts(wasMigrated);
|
unregisterDraftSources();
|
||||||
|
clearAllLoadRequests();
|
||||||
unregisterDraftSources();
|
const auto wasHistory = base::take(_history);
|
||||||
_history = history;
|
const auto wasMigrated = base::take(_migrated);
|
||||||
_migrated = _history ? _history->migrateFrom() : nullptr;
|
unloadHeavyViewParts(wasHistory);
|
||||||
registerDraftSource();
|
unloadHeavyViewParts(wasMigrated);
|
||||||
|
}
|
||||||
|
if (history) {
|
||||||
|
_history = history;
|
||||||
|
_migrated = _history ? _history->migrateFrom() : nullptr;
|
||||||
|
registerDraftSource();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::unregisterDraftSources() {
|
void HistoryWidget::unregisterDraftSources() {
|
||||||
@@ -7412,6 +7413,7 @@ HistoryWidget::~HistoryWidget() {
|
|||||||
session().api().saveDraftToCloudDelayed(_history);
|
session().api().saveDraftToCloudDelayed(_history);
|
||||||
|
|
||||||
clearAllLoadRequests();
|
clearAllLoadRequests();
|
||||||
|
setHistory(nullptr);
|
||||||
unregisterDraftSources();
|
unregisterDraftSources();
|
||||||
}
|
}
|
||||||
setTabbedPanel(nullptr);
|
setTabbedPanel(nullptr);
|
||||||
|
Reference in New Issue
Block a user