|
|
@ -92,23 +92,23 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates |
|
|
|
@override |
|
|
|
@override |
|
|
|
Future<void> refresh() async { |
|
|
|
Future<void> refresh() async { |
|
|
|
await Future.wait([ |
|
|
|
await Future.wait([ |
|
|
|
RequestManager.instance.wrapNextcloud<List<NewsFolder>, NewsListFolders>( |
|
|
|
RequestManager.instance.wrapNextcloud<List<NewsFolder>, NewsListFolders, void>( |
|
|
|
account.id, |
|
|
|
account.id, |
|
|
|
'news-folders', |
|
|
|
'news-folders', |
|
|
|
folders, |
|
|
|
folders, |
|
|
|
() async => account.client.news.listFolders(), |
|
|
|
account.client.news.listFoldersRaw(), |
|
|
|
(final response) => response.folders.toList(), |
|
|
|
(final response) => response.body.folders.toList(), |
|
|
|
), |
|
|
|
), |
|
|
|
RequestManager.instance.wrapNextcloud<List<NewsFeed>, NewsListFeeds>( |
|
|
|
RequestManager.instance.wrapNextcloud<List<NewsFeed>, NewsListFeeds, void>( |
|
|
|
account.id, |
|
|
|
account.id, |
|
|
|
'news-feeds', |
|
|
|
'news-feeds', |
|
|
|
feeds, |
|
|
|
feeds, |
|
|
|
() async => account.client.news.listFeeds(), |
|
|
|
account.client.news.listFeedsRaw(), |
|
|
|
(final response) { |
|
|
|
(final response) { |
|
|
|
if (response.newestItemId != null) { |
|
|
|
if (response.body.newestItemId != null) { |
|
|
|
_newestItemId = response.newestItemId!; |
|
|
|
_newestItemId = response.body.newestItemId!; |
|
|
|
} |
|
|
|
} |
|
|
|
return response.feeds.toList(); |
|
|
|
return response.body.feeds.toList(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
mainArticlesBloc.reload(), |
|
|
|
mainArticlesBloc.reload(), |
|
|
|