From 53204a9998bf621a5edcd891cd67160fdb0b4166 Mon Sep 17 00:00:00 2001 From: FineFindus Date: Mon, 25 Sep 2023 21:15:45 +0200 Subject: [PATCH] fix(hashtag/mute): update state on unmute --- .../fragments/HashtagTimelineFragment.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/HashtagTimelineFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/HashtagTimelineFragment.java index a9a74c420..963225526 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/HashtagTimelineFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/HashtagTimelineFragment.java @@ -166,17 +166,27 @@ public class HashtagTimelineFragment extends PinnableStatusListFragment { } private void unmuteHashtag() { //safe to get, this only called if filter is present - new DeleteFilter(filter.get().id).exec(accountID); + new DeleteFilter(filter.get().id).setCallback(new Callback<>(){ + @Override + public void onSuccess(Void result){ + updateMuteState(false); + } + + @Override + public void onError(ErrorResponse error){ + error.showToast(getContext()); + } + }).exec(accountID); } private void muteHashtag() { FilterKeyword hashtagFilter=new FilterKeyword(); hashtagFilter.wholeWord=true; hashtagFilter.keyword="#"+hashtag; - new CreateFilter("#"+hashtag, EnumSet.of(FilterContext.HOME), FilterAction.HIDE, 0 , List.of(hashtagFilter)).setCallback(new Callback(){ + new CreateFilter("#"+hashtag, EnumSet.of(FilterContext.HOME), FilterAction.HIDE, 0 , List.of(hashtagFilter)).setCallback(new Callback<>(){ @Override public void onSuccess(Filter result){ - filter = Optional.of(result); + filter=Optional.of(result); updateMuteState(true); }