feat: use targetAccount domain name in lookup dialog
This commit is contained in:
@@ -1139,6 +1139,7 @@ public class UiUtils {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String finalDomain = domain;
|
||||||
new GetSearchResults(trimmedQuery, type, false).setCallback(new Callback<>() {
|
new GetSearchResults(trimmedQuery, type, false).setCallback(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(SearchResults results) {
|
public void onSuccess(SearchResults results) {
|
||||||
@@ -1156,7 +1157,7 @@ public class UiUtils {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.wrapProgress((Activity)context, R.string.loading, true,
|
.wrapProgress((Activity)context, R.string.loading, true,
|
||||||
d -> transformDialogForLookup(context, targetAccountID, null, d))
|
d -> transformDialogForLookup(context, targetAccountID, null, d, finalDomain))
|
||||||
.execNoAuth(domain);
|
.execNoAuth(domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1164,9 +1165,13 @@ public class UiUtils {
|
|||||||
openURL(context, accountID, url, true);
|
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) {
|
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 {
|
} else {
|
||||||
dialog.setTitle(R.string.sk_loading_fediverse_resource_title);
|
dialog.setTitle(R.string.sk_loading_fediverse_resource_title);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user