mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 04:37:25 +01:00
Minor fix to updating subscribed communities
Previously, the app did not update any changes to a community after subscribing to it. Now the internal db is updated each time the list of subscribers is refreshed.
This commit is contained in:
parent
f8a21fa3ba
commit
741ec08386
@ -49,6 +49,7 @@ public class InsertSubscribedThings {
|
||||
|
||||
for (SubscribedSubredditData s : subscribedSubredditDataList) {
|
||||
if (existingSubscribedSubredditDataList.contains(s)) {
|
||||
subscribedSubredditDao.updateSubscribedSubreddit(s.getQualified_name(), s.getName(), s.getIconUrl());
|
||||
continue;
|
||||
}
|
||||
subscribedSubredditDao.insert(s);
|
||||
|
@ -36,4 +36,7 @@ public interface SubscribedSubredditDao {
|
||||
|
||||
@Query("SELECT * from subscribed_subreddits WHERE username = :qualified_name AND name LIKE '%' || :searchQuery || '%' COLLATE NOCASE AND is_favorite = 1 ORDER BY name COLLATE NOCASE ASC")
|
||||
LiveData<List<SubscribedSubredditData>> getAllFavoriteSubscribedSubredditsWithSearchQuery(String qualified_name, String searchQuery);
|
||||
|
||||
@Query("UPDATE subscribed_subreddits SET name = :displayName, icon = :icon WHERE qualified_name = :qualified_name")
|
||||
void updateSubscribedSubreddit(String qualified_name, String displayName, String icon);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user