fix: reload favorites after modified
This commit is contained in:
@@ -21,6 +21,24 @@ namespace Pixiview.Illust
|
||||
protected override ActivityIndicator LoadingIndicator => activityLoading;
|
||||
protected override bool IsDelayLoading => true;
|
||||
|
||||
protected override void OnAppearing()
|
||||
{
|
||||
if (lastUpdated != LastUpdated)
|
||||
{
|
||||
StartLoad();
|
||||
}
|
||||
else
|
||||
{
|
||||
var favorites = Stores.Favorites;
|
||||
if (favorites.Changed)
|
||||
{
|
||||
favorites.Reload();
|
||||
lastUpdated = default;
|
||||
StartLoad();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override IEnumerable<IllustItem> DoGetIllustList(IllustItem[] data)
|
||||
{
|
||||
return data;
|
||||
|
@@ -695,12 +695,6 @@ namespace Pixiview.Illust
|
||||
}
|
||||
}
|
||||
|
||||
public class IllustFavorite
|
||||
{
|
||||
public DateTime LastFavoriteUtc { get; set; }
|
||||
public List<IllustItem> Illusts { get; set; }
|
||||
}
|
||||
|
||||
public enum IllustType
|
||||
{
|
||||
Illust = 0,
|
||||
|
@@ -135,8 +135,7 @@ namespace Pixiview.Illust
|
||||
|
||||
fontIconLove = (ImageSource)Application.Current.Resources[ThemeBase.FontIconLove];
|
||||
fontIconNotLove = (ImageSource)Application.Current.Resources[ThemeBase.FontIconNotLove];
|
||||
var favorites = Stores.Favorites;
|
||||
FavoriteIcon = favorites.Any(i => i.Id == illust.Id)
|
||||
FavoriteIcon = Stores.Favorites.Any(i => i.Id == illust.Id)
|
||||
? fontIconLove
|
||||
: fontIconNotLove;
|
||||
|
||||
|
Reference in New Issue
Block a user