From 8ba3fecca388066837ef75dc2b8dbd787b2b5516 Mon Sep 17 00:00:00 2001 From: Grishka Date: Fri, 11 Mar 2022 20:25:14 +0300 Subject: [PATCH] fix --- mastodon/build.gradle | 2 +- .../java/org/joinmastodon/android/api/CacheController.java | 4 ++-- .../android/fragments/NotificationsListFragment.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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)