Commit f40d2d74 authored by Thomas's avatar Thomas
Browse files

Fix issue #819 - Lists are removed when failing to sync

parent 8a0f1049
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -243,6 +243,9 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
            if (b != null) {
                if (b.getBoolean(Helper.RECEIVE_REDRAW_TOPBAR, false)) {
                    List<MastodonList> mastodonLists = (List<MastodonList>) b.getSerializable(Helper.RECEIVE_MASTODON_LIST);
                    if (mastodonLists.size() == 0) {
                        mastodonLists = null;
                    }
                    redrawPinned(mastodonLists);
                }
                if (b.getBoolean(Helper.RECEIVE_REDRAW_BOTTOM, false)) {
@@ -1224,8 +1227,12 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
                            PinnedTimelineHelper.redrawTopBarPinned(BaseMainActivity.this, binding, pinned, bottomMenu, null);
                            //Fetch remote lists for the authenticated account and update them
                            new ViewModelProvider(BaseMainActivity.this).get(TimelinesVM.class).getLists(currentInstance, currentToken)
                                    .observe(this, mastodonLists ->
                                            PinnedTimelineHelper.redrawTopBarPinned(BaseMainActivity.this, binding, pinned, bottomMenu, mastodonLists)
                                    .observe(this, mastodonLists -> {
                                                if (mastodonLists.size() == 0) {
                                                    mastodonLists = null;
                                                }
                                                PinnedTimelineHelper.redrawTopBarPinned(BaseMainActivity.this, binding, pinned, bottomMenu, mastodonLists);
                                            }
                                    );
                        });