2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Don't suggest export if one is running.

This commit is contained in:
John Preston
2018-06-23 22:21:32 +01:00
parent 914e043abe
commit a200771868
5 changed files with 18 additions and 14 deletions

View File

@@ -92,17 +92,20 @@ void Session::suggestStartExport() {
if (_exportAvailableAt <= 0) {
return;
}
const auto now = unixtime();
const auto left = (_exportAvailableAt <= now)
? 0
: (_exportAvailableAt - now);
if (!left) {
Export::View::SuggestStart();
} else {
if (left) {
App::CallDelayed(
std::min(left + 5, 3600) * TimeMs(1000),
_session,
[=] { suggestStartExport(); });
} else if (_export) {
Export::View::ClearSuggestStart();
} else {
Export::View::SuggestStart();
}
}