From 132bd354cdf1471586e0589c41d285bb50dcb020 Mon Sep 17 00:00:00 2001 From: MChen321 <76930316+MChen321@users.noreply.github.com> Date: Fri, 17 Jun 2022 02:51:20 -0500 Subject: Fixed bug that doesnt show user being followed (#707) * In anonymous mode, fixed bug in CheckIsFollowingUser.java that does not check if accountName is null or not, which prevents room from retrieving SubscribedUserData to check if the user is followed or not. Also updated Room version to 2.4.2 to be compatible with M1 macbook. * Simplified SubscribedUserData accountName null check code --- .../infinityforreddit/asynctasks/CheckIsFollowingUser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/src/main') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/asynctasks/CheckIsFollowingUser.java b/app/src/main/java/ml/docilealligator/infinityforreddit/asynctasks/CheckIsFollowingUser.java index 2bf3657e..0e174697 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/asynctasks/CheckIsFollowingUser.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/asynctasks/CheckIsFollowingUser.java @@ -12,7 +12,7 @@ public class CheckIsFollowingUser { RedditDataRoomDatabase redditDataRoomDatabase, String username, String accountName, CheckIsFollowingUserListener checkIsFollowingUserListener) { executor.execute(() -> { - SubscribedUserData subscribedUserData = redditDataRoomDatabase.subscribedUserDao().getSubscribedUser(username, accountName); + SubscribedUserData subscribedUserData = redditDataRoomDatabase.subscribedUserDao().getSubscribedUser(username, accountName == null ? "-" : accountName); handler.post(() -> { if (subscribedUserData != null) { checkIsFollowingUserListener.isSubscribed(); -- cgit v1.2.3