From 528f81c59a856cc2da90cdf3f182b24929d39303 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 22 May 2020 04:31:12 +0100 Subject: [PATCH] Filter own claims fron downloads. Fix address input. --- .../java/io/lbry/browser/ui/publish/PublishFormFragment.java | 5 ++++- app/src/main/java/io/lbry/browser/utils/Helper.java | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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 77ae744f..0aceb571 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 @@ -516,7 +516,10 @@ public class PublishFormFragment extends BaseFragment implements } if (this.currentClaim == null && params.containsKey("suggestedUrl")) { - Helper.setViewText(inputAddress, (String) params.get("suggestedUrl")); + String suggestedUrl = (String) params.get("suggestedUrl"); + if (!Helper.isNullOrEmpty(suggestedUrl) && Helper.isNullOrEmpty(Helper.getValue(inputAddress.getText()))) { + Helper.setViewText(inputAddress, (String) params.get("suggestedUrl")); + } } } else { // shouldn't actually happen diff --git a/app/src/main/java/io/lbry/browser/utils/Helper.java b/app/src/main/java/io/lbry/browser/utils/Helper.java index 11546161..f1c6b58f 100644 --- a/app/src/main/java/io/lbry/browser/utils/Helper.java +++ b/app/src/main/java/io/lbry/browser/utils/Helper.java @@ -648,6 +648,10 @@ public final class Helper { List filtered = new ArrayList<>(); for (int i = 0; i < files.size(); i++) { LbryFile file = files.get(i); + // remove own claims as well + if (file.getClaim() != null && Lbry.ownClaims.contains(file.getClaim())) { + continue; + } if (!Helper.isNullOrEmpty(file.getDownloadPath())) { filtered.add(file); }