From 35d283b94ccaf08eb8483b6be870b9e83e43f8eb Mon Sep 17 00:00:00 2001 From: kooWZ <60533182+kooWZ@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:39:03 +0800 Subject: [PATCH] fix: favorite and subscribe holes --- lib/page/forum/hole_detail.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/page/forum/hole_detail.dart b/lib/page/forum/hole_detail.dart index 474abbf7..15e10be4 100644 --- a/lib/page/forum/hole_detail.dart +++ b/lib/page/forum/hole_detail.dart @@ -1175,14 +1175,16 @@ class Normal extends RenderModel { if (isFavored != null) return isFavored!; final List? favorites = await (ForumRepository.getInstance().getFavoriteHoleId()); - return favorites!.any((elementId) => elementId == hole.hole_id); + isFavored = favorites!.any((elementId) => elementId == hole.hole_id); + return isFavored!; } Future isHoleSubscribed() async { if (isSubscribed != null) return isSubscribed!; final List? subscriptions = await (ForumRepository.getInstance().getSubscribedHoleId()); - return subscriptions!.any((elementId) => elementId == hole.hole_id); + isSubscribed = subscriptions!.any((elementId) => elementId == hole.hole_id); + return isSubscribed!; } }