mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
parent
00504b61cd
commit
639e6d8e28
2 changed files with 6 additions and 5 deletions
|
@ -280,8 +280,9 @@ void SendFilesBox::enqueueNextPrepare() {
|
|||
}
|
||||
while (!_list.filesToProcess.empty()
|
||||
&& _list.filesToProcess.front().information) {
|
||||
addFile(std::move(_list.filesToProcess.front()));
|
||||
auto file = std::move(_list.filesToProcess.front());
|
||||
_list.filesToProcess.pop_front();
|
||||
addFile(std::move(file));
|
||||
}
|
||||
if (_list.filesToProcess.empty()) {
|
||||
return;
|
||||
|
@ -638,9 +639,6 @@ void SendFilesBox::setupSendWayControls() {
|
|||
}
|
||||
|
||||
void SendFilesBox::updateSendWayControlsVisibility() {
|
||||
if (_sendLimit == SendLimit::One) {
|
||||
return;
|
||||
}
|
||||
const auto onlyOne = (_sendLimit == SendLimit::One);
|
||||
_groupFiles->setVisible(_list.hasGroupOption(onlyOne));
|
||||
_sendImagesAsPhotos->setVisible(
|
||||
|
@ -817,10 +815,13 @@ void SendFilesBox::addPreparedAsyncFile(Ui::PreparedFile &&file) {
|
|||
}
|
||||
|
||||
void SendFilesBox::addFile(Ui::PreparedFile &&file) {
|
||||
// canBeSentInSlowmode checks for non empty filesToProcess.
|
||||
auto saved = base::take(_list.filesToProcess);
|
||||
_list.files.push_back(std::move(file));
|
||||
if (_sendLimit == SendLimit::One && !_list.canBeSentInSlowmode()) {
|
||||
_list.files.pop_back();
|
||||
}
|
||||
_list.filesToProcess = std::move(saved);
|
||||
}
|
||||
|
||||
void SendFilesBox::refreshTitleText() {
|
||||
|
|
|
@ -63,7 +63,7 @@ private:
|
|||
Fn<void()> _error;
|
||||
|
||||
struct Private;
|
||||
std::unique_ptr<Private> d;
|
||||
const std::unique_ptr<Private> d;
|
||||
base::Timer _timer;
|
||||
QByteArray _captured;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue