mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 09:49:21 +02:00
Merge pull request #3889 from deltachat/adb/issue-3688
avoid superfluous error message when user cancel configuration
This commit is contained in:
commit
700d11f600
3 changed files with 25 additions and 12 deletions
|
@ -5,6 +5,7 @@
|
|||
* target Android 15
|
||||
* improve readability of info messages in dark mode
|
||||
* fix Direct Share shortcuts
|
||||
* fix: don't show error message when cancelling profile creation
|
||||
|
||||
## v2.11.0
|
||||
2025-08
|
||||
|
|
|
@ -87,7 +87,10 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements
|
|||
|
||||
private AttachmentManager attachmentManager;
|
||||
private Bitmap avatarBmp;
|
||||
|
||||
private @Nullable ProgressDialog progressDialog;
|
||||
private boolean cancelled;
|
||||
|
||||
private DcContext dcContext;
|
||||
|
||||
@Override
|
||||
|
@ -433,7 +436,6 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements
|
|||
}
|
||||
|
||||
private void progressSuccess() {
|
||||
DcHelper.getEventCenter(this).endCaptureNextError();
|
||||
if (progressDialog != null) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
|
@ -492,11 +494,14 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements
|
|||
progressDialog = null;
|
||||
}
|
||||
|
||||
cancelled = false;
|
||||
|
||||
progressDialog = new ProgressDialog(this);
|
||||
progressDialog.setMessage(getResources().getString(R.string.one_moment));
|
||||
progressDialog.setCanceledOnTouchOutside(false);
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(android.R.string.cancel), (dialog, which) -> {
|
||||
cancelled = true;
|
||||
dcContext.stopOngoingProcess();
|
||||
});
|
||||
progressDialog.show();
|
||||
|
@ -507,10 +512,14 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements
|
|||
Rpc rpc = DcHelper.getRpc(this);
|
||||
try {
|
||||
rpc.addTransportFromQr(dcContext.getAccountId(), qrCode);
|
||||
DcHelper.getEventCenter(this).endCaptureNextError();
|
||||
progressSuccess();
|
||||
} catch (RpcException e) {
|
||||
DcHelper.getEventCenter(this).endCaptureNextError();
|
||||
if (!cancelled) {
|
||||
Util.runOnMain(() -> progressError(e.getMessage()));
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
|
|
|
@ -87,6 +87,7 @@ public class RegistrationActivity extends BaseActionBarActivity implements DcEve
|
|||
private Group advancedGroup;
|
||||
private ImageView advancedIcon;
|
||||
private ProgressDialog progressDialog;
|
||||
private boolean cancelled = false;
|
||||
|
||||
Spinner imapSecurity;
|
||||
Spinner smtpSecurity;
|
||||
|
@ -563,6 +564,7 @@ public class RegistrationActivity extends BaseActionBarActivity implements DcEve
|
|||
return;
|
||||
}
|
||||
|
||||
cancelled = false;
|
||||
setupConfig();
|
||||
|
||||
if (progressDialog != null) {
|
||||
|
@ -574,7 +576,10 @@ public class RegistrationActivity extends BaseActionBarActivity implements DcEve
|
|||
progressDialog.setMessage(getString(R.string.one_moment));
|
||||
progressDialog.setCanceledOnTouchOutside(false);
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getString(android.R.string.cancel), (dialog, which) -> stopLoginProcess());
|
||||
progressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getString(android.R.string.cancel), (dialog, which) -> {
|
||||
cancelled = true;
|
||||
DcHelper.getContext(this).stopOngoingProcess();
|
||||
});
|
||||
progressDialog.show();
|
||||
}
|
||||
|
||||
|
@ -613,12 +618,14 @@ public class RegistrationActivity extends BaseActionBarActivity implements DcEve
|
|||
startActivity(conversationList);
|
||||
finish();
|
||||
} catch (RpcException e) {
|
||||
Util.runOnMain(() -> {
|
||||
DcHelper.getEventCenter(this).endCaptureNextError();
|
||||
if (!cancelled) {
|
||||
Util.runOnMain(() -> {
|
||||
progressDialog.dismiss();
|
||||
WelcomeActivity.maybeShowConfigurationError(this, e.getMessage());
|
||||
});
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
|
@ -631,10 +638,6 @@ public class RegistrationActivity extends BaseActionBarActivity implements DcEve
|
|||
return value.isEmpty()? null : value;
|
||||
}
|
||||
|
||||
private void stopLoginProcess() {
|
||||
DcHelper.getContext(this).stopOngoingProcess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleEvent(@NonNull DcEvent event) {
|
||||
if (event.getId()==DcContext.DC_EVENT_CONFIGURE_PROGRESS) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue