mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Address review feedback for mailbox troubleshooting wizard
This commit is contained in:
@@ -143,7 +143,7 @@ public class MailboxStatusFragment extends Fragment {
|
||||
title = getString(R.string.mailbox_status_problem_title);
|
||||
tintRes = R.color.briar_orange_500;
|
||||
showUnlinkWarning = false;
|
||||
wizardButton.setVisibility(GONE);
|
||||
wizardButton.setVisibility(VISIBLE);
|
||||
} else {
|
||||
tintRes = R.color.briar_red_500;
|
||||
title = getString(R.string.mailbox_status_failure_title);
|
||||
|
||||
@@ -206,20 +206,16 @@ class MailboxViewModel extends DbViewModel
|
||||
MutableLiveData<Boolean> liveData = new MutableLiveData<>();
|
||||
checkConnection(success -> {
|
||||
liveData.postValue(success);
|
||||
if (!success) { // force failure screen
|
||||
MailboxStatus lastStatus = status.getValue();
|
||||
long lastSuccess = lastStatus == null ?
|
||||
-1 : lastStatus.getTimeOfLastSuccess();
|
||||
long now = System.currentTimeMillis();
|
||||
status.postValue(new MailboxStatus(now, lastSuccess, 999));
|
||||
}
|
||||
if (!success) onConnectionCheckFailure();
|
||||
});
|
||||
return liveData;
|
||||
}
|
||||
|
||||
void checkConnectionFromWizard() {
|
||||
checkConnection(success -> {
|
||||
if (!success) onConnectionCheckFailure();
|
||||
boolean isOnline = isTorActive();
|
||||
// make UI move back to status fragment by changing pairingState
|
||||
pairingState.postEvent(new MailboxState.IsPaired(isOnline));
|
||||
});
|
||||
}
|
||||
@@ -234,6 +230,15 @@ class MailboxViewModel extends DbViewModel
|
||||
});
|
||||
}
|
||||
|
||||
private void onConnectionCheckFailure() {
|
||||
MailboxStatus lastStatus = status.getValue();
|
||||
long lastSuccess = lastStatus == null ?
|
||||
-1 : lastStatus.getTimeOfLastSuccess();
|
||||
long now = System.currentTimeMillis();
|
||||
// force failure screen
|
||||
status.postValue(new MailboxStatus(now, lastSuccess, 999));
|
||||
}
|
||||
|
||||
@UiThread
|
||||
void unlink() {
|
||||
ioExecutor.execute(() -> {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</merge>
|
||||
|
||||
@@ -662,11 +662,14 @@
|
||||
<string name="mailbox_error_wizard_question1_1">Open the Mailbox app. What do you see?</string>
|
||||
<string name="mailbox_error_wizard_answer1_1">I see instructions for setting up the Mailbox</string>
|
||||
<string name="mailbox_error_wizard_answer1_2">I see a QR code</string>
|
||||
<string name="mailbox_error_wizard_answer1_3">I see \"Mailbox is online\"</string>
|
||||
<string name="mailbox_error_wizard_answer1_4">I see \"Mailbox is offline\"</string>
|
||||
<string name="mailbox_error_wizard_answer1_3">I see \"Mailbox is running\"</string>
|
||||
<string name="mailbox_error_wizard_answer1_4">I see \"Device offline\"</string>
|
||||
<string name="mailbox_error_wizard_info1_1_1">Please unlink your Mailbox using the button below, then follow the instructions on the Mailbox device to link it again.</string>
|
||||
<string name="mailbox_error_wizard_info_1_1_2">Please unlink your Mailbox using the button below, then scan the QR code to link it again.</string>
|
||||
<string name="mailbox_error_wizard_info1_1_3">Please use the button below to check the connection between Briar and the Mailbox.\n\nIf the connection fails again:\n* Check that the Mailbox and Briar apps are updated to the latest version.\n* Restart your Mailbox and Briar devices and try again.</string>
|
||||
<string name="mailbox_error_wizard_info1_1_3">Please use the button below to check the connection between Briar and the Mailbox.\n\n
|
||||
If the connection fails again:\n
|
||||
\u2022 Check that the Mailbox and Briar apps are updated to the latest version.\n
|
||||
\u2022 Restart your Mailbox and Briar devices and try again.</string>
|
||||
<string name="mailbox_error_wizard_info1_1_4">Check that the mailbox device is properly connected to the Internet.\n\nCheck that the clock on the Mailbox device shows the right time, date and timezone.\n\nCheck that the Mailbox and Briar apps are updated to the latest version.\n\nRestart your Mailbox and Briar devices and try again.</string>
|
||||
<string name="mailbox_error_wizard_info2">Please come back to this screen when you have access to the device.</string>
|
||||
<string name="mailbox_error_wizard_info3">Please unlink your mailbox using the button below.\n\nAfter unlinking your old Mailbox, you can set up a new Mailbox at any time.</string>
|
||||
|
||||
Reference in New Issue
Block a user