mirror of
https://github.com/telegramdesktop/tdesktop
synced 2024-12-27 00:53:22 +00:00
Fix partial value saving in passport.
This commit is contained in:
parent
ccb57a6d69
commit
9142313a6b
@ -798,12 +798,16 @@ void FormController::saveValueEdit(
|
||||
|
||||
const auto nonconst = findValue(value);
|
||||
if (!editValueChanged(nonconst, data)) {
|
||||
base::take(nonconst->filesInEdit);
|
||||
base::take(nonconst->selfieInEdit);
|
||||
base::take(nonconst->data.encryptedSecretInEdit);
|
||||
base::take(nonconst->data.hashInEdit);
|
||||
base::take(nonconst->data.parsedInEdit);
|
||||
_valueSaveFinished.fire_copy(nonconst);
|
||||
nonconst->saveRequestId = -1;
|
||||
crl::on_main(this, [=] {
|
||||
base::take(nonconst->filesInEdit);
|
||||
base::take(nonconst->selfieInEdit);
|
||||
base::take(nonconst->data.encryptedSecretInEdit);
|
||||
base::take(nonconst->data.hashInEdit);
|
||||
base::take(nonconst->data.parsedInEdit);
|
||||
nonconst->saveRequestId = 0;
|
||||
_valueSaveFinished.fire_copy(nonconst);
|
||||
});
|
||||
return;
|
||||
}
|
||||
nonconst->data.parsedInEdit = std::move(data);
|
||||
|
@ -542,13 +542,11 @@ void PanelController::requestScopeFilesType(int index) {
|
||||
Expects(index >= 0 && index < _scopes.size());
|
||||
|
||||
const auto type = _scopes[index].type;
|
||||
const auto box = std::make_shared<QPointer<BoxContent>>();
|
||||
*box = [&] {
|
||||
_scopeFilesTypeBox = [&] {
|
||||
if (type == Scope::Type::Identity) {
|
||||
return show(RequestIdentityType(
|
||||
[=](int filesIndex) {
|
||||
editWithUpload(index, filesIndex);
|
||||
(*box)->closeBox();
|
||||
},
|
||||
ranges::view::all(
|
||||
_scopes[index].files
|
||||
@ -570,7 +568,6 @@ void PanelController::requestScopeFilesType(int index) {
|
||||
return show(RequestAddressType(
|
||||
[=](int filesIndex) {
|
||||
editWithUpload(index, filesIndex);
|
||||
(*box)->closeBox();
|
||||
},
|
||||
ranges::view::all(
|
||||
_scopes[index].files
|
||||
@ -602,6 +599,7 @@ void PanelController::editWithUpload(int index, int filesIndex) {
|
||||
EditScans::ChooseScan(
|
||||
base::lambda_guarded(_panel.get(),
|
||||
[=](QByteArray &&content) {
|
||||
base::take(_scopeFilesTypeBox);
|
||||
editScope(index, filesIndex);
|
||||
uploadScan(std::move(content));
|
||||
}));
|
||||
|
@ -111,6 +111,7 @@ private:
|
||||
BoxPointer _confirmForgetChangesBox;
|
||||
Scope *_editScope = nullptr;
|
||||
int _editScopeFilesIndex = -1;
|
||||
BoxPointer _scopeFilesTypeBox;
|
||||
std::map<not_null<const Value*>, BoxPointer> _verificationBoxes;
|
||||
|
||||
rpl::lifetime _lifetime;
|
||||
|
Loading…
Reference in New Issue
Block a user