mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 14:47:29 +00:00
Prevent DM button double click and check current fragment still attached before navigating. Fixes a crash reported in telegram group.
This commit is contained in:
parent
4ffab14ff3
commit
8829f4a66e
@ -800,10 +800,17 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe
|
|||||||
PostItemType.TAGGED);
|
PostItemType.TAGGED);
|
||||||
NavHostFragment.findNavController(this).navigate(action);
|
NavHostFragment.findNavController(this).navigate(action);
|
||||||
});
|
});
|
||||||
profileDetailsBinding.btnDM.setOnClickListener(v -> new CreateThreadAction(cookie, profileModel.getId(), threadId -> {
|
profileDetailsBinding.btnDM.setOnClickListener(v -> {
|
||||||
final NavDirections action = ProfileFragmentDirections.actionProfileFragmentToDMThreadFragment(threadId, profileModel.getUsername());
|
profileDetailsBinding.btnDM.setEnabled(false);
|
||||||
NavHostFragment.findNavController(this).navigate(action);
|
new CreateThreadAction(cookie, profileModel.getId(), threadId -> {
|
||||||
}).execute());
|
if (isAdded()) {
|
||||||
|
final NavDirections action = ProfileFragmentDirections
|
||||||
|
.actionProfileFragmentToDMThreadFragment(threadId, profileModel.getUsername());
|
||||||
|
NavHostFragment.findNavController(this).navigate(action);
|
||||||
|
}
|
||||||
|
profileDetailsBinding.btnDM.setEnabled(true);
|
||||||
|
}).execute();
|
||||||
|
});
|
||||||
profileDetailsBinding.mainProfileImage.setOnClickListener(v -> {
|
profileDetailsBinding.mainProfileImage.setOnClickListener(v -> {
|
||||||
if (!hasStories) {
|
if (!hasStories) {
|
||||||
// show profile pic
|
// show profile pic
|
||||||
|
Loading…
Reference in New Issue
Block a user