Skip to content

Commit

Permalink
PIA-1478: Fix latencies not showing after logging in
Browse files Browse the repository at this point in the history
  • Loading branch information
kp-juan-docal committed Mar 5, 2024
1 parent 1d3679b commit 9fd1978
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import com.privateinternetaccess.android.PIAApplication;
import com.privateinternetaccess.android.R;
import com.privateinternetaccess.android.pia.PIAFactory;
import com.privateinternetaccess.android.pia.handlers.PIAServerHandler;
import com.privateinternetaccess.android.pia.handlers.PiaPrefHandler;
import com.privateinternetaccess.android.pia.interfaces.IAccount;
import com.privateinternetaccess.android.pia.model.AmazonPurchaseData;
Expand Down Expand Up @@ -271,7 +272,6 @@ public void startLogin() {
handleLoginResponseStatus(context, requestResponseStatus);
return null;
}

account.accountInformation((accountInformation, accountResponseStatus) -> {
if (accountResponseStatus != RequestResponseStatus.SUCCEEDED) {
DLog.d(TAG, "Check account information unsuccessful " + accountResponseStatus);
Expand All @@ -283,6 +283,7 @@ public void startLogin() {
PiaPrefHandler.setUserIsLoggedIn(context, true);
PiaPrefHandler.saveAccountInformation(context, accountInformation);
PiaPrefHandler.clearPurchasingInfo(context);
updateListOfServersAndLatencies();
handleLoginResponseStatus(context, accountResponseStatus);
return null;
});
Expand Down Expand Up @@ -403,4 +404,13 @@ public void onMagicLinkClicked() {
private LoginPurchaseActivity getLoginPurchaseActivity() {
return ((LoginPurchaseActivity) getActivity());
}

private void updateListOfServersAndLatencies() {
PIAServerHandler.getInstance(getContext()).triggerFetchServers(error -> {
if (error == null) {
PIAServerHandler.getInstance(getContext()).triggerLatenciesUpdate();
}
return null;
});
}
}

0 comments on commit 9fd1978

Please sign in to comment.