diff --git a/app/src/main/java/org/mian/gitnex/activities/DeepLinksActivity.java b/app/src/main/java/org/mian/gitnex/activities/DeepLinksActivity.java index 2e7264cd..0289c4be 100644 --- a/app/src/main/java/org/mian/gitnex/activities/DeepLinksActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/DeepLinksActivity.java @@ -43,6 +43,7 @@ public class DeepLinksActivity extends BaseActivity { private TinyDB tinyDb; private String currentInstance; private String instanceToken; + private boolean noAccountFound = false; private Intent mainIntent; private Intent issueIntent; @@ -94,15 +95,22 @@ public class DeepLinksActivity extends BaseActivity { currentInstance = userAccounts.get(i).getInstanceUrl(); instanceToken = userAccounts.get(i).getToken(); - if(!hostUri.contains(Objects.requireNonNull(data.getHost()))) { + if(hostUri.toLowerCase().contains(Objects.requireNonNull(data.getHost().toLowerCase()))) { - // check for valid instance - checkInstance(data); - return; + noAccountFound = false; + break; } + + noAccountFound = true; } } + if(noAccountFound) { + + checkInstance(data); + return; + } + // redirect to proper fragment/activity, If no action is there, show options where user to want to go like repos, profile, notifications etc if(data.getPathSegments().size() > 0) { @@ -113,7 +121,6 @@ public class DeepLinksActivity extends BaseActivity { if(!Objects.requireNonNull(data.getLastPathSegment()).contains("issues") & StringUtils.isNumeric(data.getLastPathSegment())) { - issueIntent.putExtra("issueNumber", data.getLastPathSegment()); tinyDb.putString("issueNumber", data.getLastPathSegment()); @@ -325,6 +332,11 @@ public class DeepLinksActivity extends BaseActivity { finish(); }); } + else { + + Toasty.error(ctx, getResources().getString(R.string.versionUnknown)); + finish(); + } } @Override