From aaec6ac6a34d38bc6956fff2cf9d88e2754d5209 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Mon, 25 May 2020 06:00:34 +0100 Subject: [PATCH] wait for uploads to finish before saving channel form --- .../io/lbry/browser/ui/channel/ChannelFormFragment.java | 7 ++++++- .../io/lbry/browser/ui/publish/PublishFormFragment.java | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/lbry/browser/ui/channel/ChannelFormFragment.java b/app/src/main/java/io/lbry/browser/ui/channel/ChannelFormFragment.java index aa191c1c..c7a5fc49 100644 --- a/app/src/main/java/io/lbry/browser/ui/channel/ChannelFormFragment.java +++ b/app/src/main/java/io/lbry/browser/ui/channel/ChannelFormFragment.java @@ -211,7 +211,7 @@ public class ChannelFormFragment extends BaseFragment implements @Override public void onClick(View view) { if (uploading) { - Snackbar.make(getView(), R.string.wait_for_upload, Snackbar.LENGTH_LONG).show(); + Snackbar.make(view, R.string.wait_for_upload, Snackbar.LENGTH_LONG).show(); return; } @@ -222,6 +222,11 @@ public class ChannelFormFragment extends BaseFragment implements buttonSave.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { + if (uploading) { + Snackbar.make(view, R.string.wait_for_upload, Snackbar.LENGTH_LONG).show(); + return; + } + Claim claimToSave = buildChannelClaimToSave(); validateAndSaveClaim(claimToSave); } diff --git a/app/src/main/java/io/lbry/browser/ui/publish/PublishFormFragment.java b/app/src/main/java/io/lbry/browser/ui/publish/PublishFormFragment.java index ca17b4ae..2f6fcdf4 100644 --- a/app/src/main/java/io/lbry/browser/ui/publish/PublishFormFragment.java +++ b/app/src/main/java/io/lbry/browser/ui/publish/PublishFormFragment.java @@ -428,10 +428,10 @@ public class PublishFormFragment extends BaseFragment implements @Override public void onClick(View view) { if (uploading) { - Snackbar.make(view, R.string.publish_no_thumbnail, Snackbar.LENGTH_LONG).show(); + Snackbar.make(view, R.string.publish_thumbnail_in_progress, Snackbar.LENGTH_LONG).show(); return; } else if (Helper.isNullOrEmpty(uploadedThumbnailUrl)) { - showError(getString(R.string.publish_thumbnail_in_progress)); + showError(getString(R.string.publish_no_thumbnail)); return; }