Tag cannot be pinned

This commit is contained in:
Thomas 2023-01-11 17:35:46 +01:00
parent 39f248e0a6
commit bc8dfec325

View file

@ -105,21 +105,22 @@ public class HashTagActivity extends BaseActivity {
}); });
ReorderVM reorderVM = new ViewModelProvider(HashTagActivity.this).get(ReorderVM.class); ReorderVM reorderVM = new ViewModelProvider(HashTagActivity.this).get(ReorderVM.class);
reorderVM.getAllPinned().observe(HashTagActivity.this, pinned -> { reorderVM.getAllPinned().observe(HashTagActivity.this, pinned -> {
if (pinned != null) { if (pinned == null) {
this.pinned = pinned; pinned = new Pinned();
pinnedTag = false; pinned.pinnedTimelines = new ArrayList<>();
if (pinned.pinnedTimelines != null) { }
for (PinnedTimeline pinnedTimeline : pinned.pinnedTimelines) { pinnedTag = false;
if (pinnedTimeline.tagTimeline != null) { if (pinned.pinnedTimelines != null) {
if (pinnedTimeline.tagTimeline.name.equalsIgnoreCase(stripTag)) { for (PinnedTimeline pinnedTimeline : pinned.pinnedTimelines) {
this.pinnedTimeline = pinnedTimeline; if (pinnedTimeline.tagTimeline != null) {
pinnedTag = true; if (pinnedTimeline.tagTimeline.name.equalsIgnoreCase(stripTag)) {
break; this.pinnedTimeline = pinnedTimeline;
} pinnedTag = true;
break;
} }
} }
invalidateOptionsMenu();
} }
invalidateOptionsMenu();
} }
}); });
if (MainActivity.filterFetched && MainActivity.mainFilters != null) { if (MainActivity.filterFetched && MainActivity.mainFilters != null) {