Skip to content

Commit

Permalink
Merge pull request #427 from FineFindus/fix/erro-null-url
Browse files Browse the repository at this point in the history
fix(ErrorStatusDisplayItem): disable open in browser button on null URL
  • Loading branch information
LucasGGamerM authored Jun 13, 2024
2 parents 6ad8a85 + f9f8c4a commit 57911ce
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.os.Build;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import org.joinmastodon.android.BuildConfig;
import org.joinmastodon.android.R;
Expand Down Expand Up @@ -32,7 +33,9 @@ public static class Holder extends StatusDisplayItem.Holder<ErrorStatusDisplayIt

public Holder(Context context, ViewGroup parent) {
super(context, R.layout.display_item_error, parent);
findViewById(R.id.button_open_browser).setOnClickListener(v -> UiUtils.launchWebBrowser(v.getContext(), item.status.url));
Button openInBrowserButton=findViewById(R.id.button_open_browser);
openInBrowserButton.setEnabled(item.status.url!=null);
openInBrowserButton.setOnClickListener(v -> UiUtils.launchWebBrowser(v.getContext(), item.status.url));
findViewById(R.id.button_copy_error_details).setOnClickListener(this::copyErrorDetails);
}

Expand Down

0 comments on commit 57911ce

Please sign in to comment.