diff --git a/mastodon/build.gradle b/mastodon/build.gradle index d46f405d..1982229e 100644 --- a/mastodon/build.gradle +++ b/mastodon/build.gradle @@ -10,7 +10,7 @@ android { applicationId "org.joinmastodon.android" minSdk 23 targetSdk 31 - versionCode 9 + versionCode 10 versionName "0.1" } diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/CacheController.java b/mastodon/src/main/java/org/joinmastodon/android/api/CacheController.java index 62122d55..427e93dc 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/CacheController.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/CacheController.java @@ -50,7 +50,7 @@ public class CacheController{ databaseThread.postRunnable(()->{ try{ SQLiteDatabase db=getOrOpenDatabase(); - try(Cursor cursor=db.query("home_timeline", new String[]{"json"}, maxID==null ? null : "`id`>?", maxID==null ? null : new String[]{maxID}, null, null, "`id` DESC", count+"")){ + try(Cursor cursor=db.query("home_timeline", new String[]{"json"}, maxID==null ? null : "`id` result=new ArrayList<>(); cursor.moveToFirst(); @@ -114,7 +114,7 @@ public class CacheController{ databaseThread.postRunnable(()->{ try{ SQLiteDatabase db=getOrOpenDatabase(); - try(Cursor cursor=db.query(onlyMentions ? "notifications_mentions" : "notifications_all", new String[]{"json"}, maxID==null ? null : "`id`>?", maxID==null ? null : new String[]{maxID}, null, null, "`id` DESC", count+"")){ + try(Cursor cursor=db.query(onlyMentions ? "notifications_mentions" : "notifications_all", new String[]{"json"}, maxID==null ? null : "`id` result=new ArrayList<>(); cursor.moveToFirst(); diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java index 3826d2d7..2f780b65 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java @@ -95,7 +95,7 @@ public class NotificationsListFragment extends BaseStatusListFragment0 ? getMaxID() : null, count, onlyMentions, new SimpleCallback>(this){ + .getNotifications(offset>0 ? getMaxID() : null, count, onlyMentions, new SimpleCallback<>(this){ @Override public void onSuccess(List result){ if(refreshing)