mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 06:37:30 +00:00
Fix profile fetching when username sometimes without '@'
This commit is contained in:
parent
bbe87c8dbd
commit
16fd56c7e5
@ -592,8 +592,11 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe
|
||||
|
||||
private void fetchProfileDetails() {
|
||||
accountIsUpdated = false;
|
||||
new ProfileFetcher(TextUtils.isEmpty(username) ? null : username.trim().substring(1),
|
||||
myId, isLoggedIn, new FetchListener<User>() {
|
||||
String usernameTemp = username.trim();
|
||||
if (usernameTemp.startsWith("@")) {
|
||||
usernameTemp = usernameTemp.substring(1);
|
||||
}
|
||||
new ProfileFetcher(TextUtils.isEmpty(username) ? null : usernameTemp, myId, isLoggedIn, new FetchListener<User>() {
|
||||
@Override
|
||||
public void onResult(final User user) {
|
||||
if (getContext() == null) return;
|
||||
@ -614,7 +617,7 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe
|
||||
isLoggedIn ? R.string.error_loading_profile_loggedin : R.string.error_loading_profile,
|
||||
Toast.LENGTH_LONG).show();
|
||||
else Toast.makeText(context, t.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
} catch (final Throwable e) {}
|
||||
} catch (final Throwable ignored) {}
|
||||
}
|
||||
|
||||
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
|
Loading…
Reference in New Issue
Block a user