mirror of
				https://codeberg.org/tom79/Fedilab.git
				synced 2025-10-20 11:20:16 +03:00 
			
		
		
		
	Fix issue #819 - Lists are removed when failing to sync
This commit is contained in:
		
							parent
							
								
									8a0f104992
								
							
						
					
					
						commit
						f40d2d7424
					
				
					 1 changed files with 9 additions and 2 deletions
				
			
		| 
						 | 
					@ -243,6 +243,9 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
 | 
				
			||||||
            if (b != null) {
 | 
					            if (b != null) {
 | 
				
			||||||
                if (b.getBoolean(Helper.RECEIVE_REDRAW_TOPBAR, false)) {
 | 
					                if (b.getBoolean(Helper.RECEIVE_REDRAW_TOPBAR, false)) {
 | 
				
			||||||
                    List<MastodonList> mastodonLists = (List<MastodonList>) b.getSerializable(Helper.RECEIVE_MASTODON_LIST);
 | 
					                    List<MastodonList> mastodonLists = (List<MastodonList>) b.getSerializable(Helper.RECEIVE_MASTODON_LIST);
 | 
				
			||||||
 | 
					                    if (mastodonLists.size() == 0) {
 | 
				
			||||||
 | 
					                        mastodonLists = null;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
                    redrawPinned(mastodonLists);
 | 
					                    redrawPinned(mastodonLists);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                if (b.getBoolean(Helper.RECEIVE_REDRAW_BOTTOM, false)) {
 | 
					                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);
 | 
					                            PinnedTimelineHelper.redrawTopBarPinned(BaseMainActivity.this, binding, pinned, bottomMenu, null);
 | 
				
			||||||
                            //Fetch remote lists for the authenticated account and update them
 | 
					                            //Fetch remote lists for the authenticated account and update them
 | 
				
			||||||
                            new ViewModelProvider(BaseMainActivity.this).get(TimelinesVM.class).getLists(currentInstance, currentToken)
 | 
					                            new ViewModelProvider(BaseMainActivity.this).get(TimelinesVM.class).getLists(currentInstance, currentToken)
 | 
				
			||||||
                                    .observe(this, mastodonLists ->
 | 
					                                    .observe(this, mastodonLists -> {
 | 
				
			||||||
                                            PinnedTimelineHelper.redrawTopBarPinned(BaseMainActivity.this, binding, pinned, bottomMenu, mastodonLists)
 | 
					                                                if (mastodonLists.size() == 0) {
 | 
				
			||||||
 | 
					                                                    mastodonLists = null;
 | 
				
			||||||
 | 
					                                                }
 | 
				
			||||||
 | 
					                                                PinnedTimelineHelper.redrawTopBarPinned(BaseMainActivity.this, binding, pinned, bottomMenu, mastodonLists);
 | 
				
			||||||
 | 
					                                            }
 | 
				
			||||||
                                    );
 | 
					                                    );
 | 
				
			||||||
                        });
 | 
					                        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue