Skip to content

Commit

Permalink
Merge pull request #127 from Gamhub-io/fixes/feed_reload
Browse files Browse the repository at this point in the history
Fixes/feed reload
  • Loading branch information
bricefriha authored Jun 5, 2024
2 parents a67cd87 + bebf0fe commit 3f67f49
Showing 1 changed file with 25 additions and 26 deletions.
51 changes: 25 additions & 26 deletions AresNews/AresNews/ViewModels/NewsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -550,31 +550,30 @@ public async Task FetchArticles(bool isFullRefresh = false)
return;
}

if (OnTopScroll)
{
// Update list of articles
UpdateArticles(articles);
try
{
// Manage backup
_ = RefreshDB();

}
catch
{
}
finally
{
_isLaunching = false;
}

IsRefreshing = false;
}

else
{
UnnoticedArticles = new ObservableCollection<Article>(articles);
}
if (OnTopScroll)
{
// Update list of articles
UpdateArticles(articles);
try
{
// Manage backup
_ = RefreshDB();

}
catch
{
}
finally
{
_isLaunching = false;
}

IsRefreshing = false;
}

else
UnnoticedArticles = new ObservableCollection<Article>(articles);
IsRefreshing = false;


}
Expand All @@ -585,7 +584,7 @@ public async Task FetchArticles(bool isFullRefresh = false)
private void UpdateArticles(IEnumerable<Article> articles)
{
// Create a copy of the input ObservableCollection
Collection<Article> listArticle = new (articles.ToList());
Collection<Article> listArticle = new (articles.Reverse().ToList());

// Lists to store articles to be added and updated
Collection<Article> articlesToUpdate = new ();
Expand Down

0 comments on commit 3f67f49

Please sign in to comment.