fix: Proper service is being used for filtering

This commit is contained in:
Jacques 2024-01-30 10:58:19 +01:00
parent 525d8d3be6
commit d16cd74a33

View file

@ -94,9 +94,9 @@ class _TimelineScreenState extends State<TimelineScreen> {
var posts = widget.posts ?? service.postService.getPosts(category); var posts = widget.posts ?? service.postService.getPosts(category);
if (widget.filterEnabled && filterWord != null) { if (widget.filterEnabled && filterWord != null) {
if (service is TimelineFilterService?) { if (service.postService is TimelineFilterService) {
posts = posts = (service.postService as TimelineFilterService)
(service as TimelineFilterService).filterPosts(filterWord!, {}); .filterPosts(filterWord!, {});
} else { } else {
debugPrint('Timeline service needs to mixin' debugPrint('Timeline service needs to mixin'
' with TimelineFilterService'); ' with TimelineFilterService');