ShowNoData for main page

This commit is contained in:
Kyle Spearrin 2019-06-05 13:59:08 -04:00
parent c8d8d94c7f
commit 7d8dfb997e

View file

@ -59,9 +59,6 @@ namespace Bit.App.Pages
CipherOptionsCommand = new Command<CipherView>(CipherOptionsAsync); CipherOptionsCommand = new Command<CipherView>(CipherOptionsAsync);
} }
public bool ShowFavorites { get; set; } = true;
public bool ShowFolders { get; set; } = true;
public bool ShowCollections { get; set; } = true;
public bool MainPage { get; set; } public bool MainPage { get; set; }
public CipherType? Type { get; set; } public CipherType? Type { get; set; }
public string FolderId { get; set; } public string FolderId { get; set; }
@ -70,6 +67,7 @@ namespace Bit.App.Pages
public bool HasCiphers { get; set; } public bool HasCiphers { get; set; }
public bool HasFolders { get; set; } public bool HasFolders { get; set; }
public bool HasCollections { get; set; }
public List<CipherView> Ciphers { get; set; } public List<CipherView> Ciphers { get; set; }
public List<CipherView> FavoriteCiphers { get; set; } public List<CipherView> FavoriteCiphers { get; set; }
public List<CipherView> NoFolderCiphers { get; set; } public List<CipherView> NoFolderCiphers { get; set; }
@ -216,11 +214,11 @@ namespace Bit.App.Pages
finally finally
{ {
_doingLoad = false; _doingLoad = false;
ShowNoData = !groupedItems.Any();
ShowList = !ShowNoData;
Loaded = true; Loaded = true;
Loading = false; Loading = false;
Refreshing = false; Refreshing = false;
ShowNoData = (MainPage && !HasCiphers) || !groupedItems.Any();
ShowList = !ShowNoData;
} }
} }
@ -301,21 +299,17 @@ namespace Bit.App.Pages
_collectionCounts.Clear(); _collectionCounts.Clear();
_typeCounts.Clear(); _typeCounts.Clear();
HasFolders = false; HasFolders = false;
HasCollections = false;
Filter = null; Filter = null;
if(MainPage) if(MainPage)
{ {
if(ShowFolders) Folders = await _folderService.GetAllDecryptedAsync();
{ NestedFolders = await _folderService.GetAllNestedAsync();
Folders = await _folderService.GetAllDecryptedAsync(); HasFolders = NestedFolders.Any();
NestedFolders = await _folderService.GetAllNestedAsync(); Collections = await _collectionService.GetAllDecryptedAsync();
HasFolders = Folders.Any(); NestedCollections = await _collectionService.GetAllNestedAsync(Collections);
} HasCollections = NestedCollections.Any();
if(ShowCollections)
{
Collections = await _collectionService.GetAllDecryptedAsync();
NestedCollections = await _collectionService.GetAllNestedAsync(Collections);
}
} }
else else
{ {