diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java index 33a0a3184..e7e367379 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java @@ -1139,6 +1139,7 @@ public class UiUtils { return; } + String finalDomain = domain; new GetSearchResults(trimmedQuery, type, false).setCallback(new Callback<>() { @Override public void onSuccess(SearchResults results) { @@ -1156,7 +1157,7 @@ public class UiUtils { } }) .wrapProgress((Activity)context, R.string.loading, true, - d -> transformDialogForLookup(context, targetAccountID, null, d)) + d -> transformDialogForLookup(context, targetAccountID, null, d, finalDomain)) .execNoAuth(domain); } @@ -1164,9 +1165,13 @@ public class UiUtils { openURL(context, accountID, url, true); } - private static void transformDialogForLookup(Context context, String accountID, @Nullable String url, ProgressDialog dialog) { + private static void transformDialogForLookup(Context context, String accountID, @Nullable String url, ProgressDialog dialog){ + transformDialogForLookup(context, accountID, url, dialog, null); + } + + private static void transformDialogForLookup(Context context, String accountID, @Nullable String url, ProgressDialog dialog, @Nullable String instanceName) { if (accountID != null) { - dialog.setTitle(context.getString(R.string.sk_loading_resource_on_instance_title, getInstanceName(accountID))); + dialog.setTitle(context.getString(R.string.sk_loading_resource_on_instance_title, instanceName != null ? instanceName : getInstanceName(accountID))); } else { dialog.setTitle(R.string.sk_loading_fediverse_resource_title); }