Warn on passport save before upload is finished.

This commit is contained in:
John Preston
2018-07-10 22:32:34 +03:00
parent e3e8d083ea
commit 7be9e0fb94
3 changed files with 13 additions and 1 deletions
@@ -1065,6 +1065,13 @@ void PanelController::processValueSaveFinished(
}
}
bool PanelController::uploadingScopeScan() const {
Expects(_editValue != nullptr);
return _form->uploadingScan(_editValue)
|| (_editDocument && _form->uploadingScan(_editDocument));
}
bool PanelController::savingScope() const {
Expects(_editValue != nullptr);
@@ -1179,7 +1186,10 @@ void PanelController::saveScope(ValueMap &&data, ValueMap &&filesData) {
Expects(_panel != nullptr);
Expects(_editValue != nullptr);
if (savingScope()) {
if (uploadingScopeScan()) {
showToast(lang(lng_passport_wait_upload));
return;
} else if (savingScope()) {
return;
}
@@ -144,6 +144,7 @@ private:
void processVerificationNeeded(not_null<const Value*> value);
bool savingScope() const;
bool uploadingScopeScan() const;
bool hasValueDocument() const;
bool hasValueFields() const;
ScanInfo collectScanInfo(const EditFile &file) const;