aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/AnonymousSubscriptionsActivity.java11
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/asynctasks/CheckIsSubscribedToSubreddit.java2
2 files changed, 12 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/AnonymousSubscriptionsActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/AnonymousSubscriptionsActivity.java
index 2c40b1e8..f0e753b7 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/AnonymousSubscriptionsActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/AnonymousSubscriptionsActivity.java
@@ -3,10 +3,12 @@ package ml.docilealligator.infinityforreddit.activities;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
+import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
+import androidx.annotation.NonNull;
import androidx.appcompat.widget.Toolbar;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
@@ -99,4 +101,13 @@ public class AnonymousSubscriptionsActivity extends BaseActivity {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar);
}
+
+ @Override
+ public boolean onOptionsItemSelected(@NonNull MenuItem item) {
+ if (item.getItemId() == android.R.id.home) {
+ finish();
+ return true;
+ }
+ return false;
+ }
} \ No newline at end of file
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/asynctasks/CheckIsSubscribedToSubreddit.java b/app/src/main/java/ml/docilealligator/infinityforreddit/asynctasks/CheckIsSubscribedToSubreddit.java
index d977f159..f6768d11 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/asynctasks/CheckIsSubscribedToSubreddit.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/asynctasks/CheckIsSubscribedToSubreddit.java
@@ -16,7 +16,7 @@ public class CheckIsSubscribedToSubreddit {
if (!redditDataRoomDatabase.accountDao().isAnonymousAccountInserted()) {
redditDataRoomDatabase.accountDao().insertAnonymousAccount();
}
- SubscribedSubredditData subscribedSubredditData = redditDataRoomDatabase.subscribedSubredditDao().getSubscribedSubreddit(subredditName, accountName);
+ SubscribedSubredditData subscribedSubredditData = redditDataRoomDatabase.subscribedSubredditDao().getSubscribedSubreddit(subredditName, accountName == null ? "-" : accountName);
handler.post(() -> {
if (subscribedSubredditData != null) {
checkIsSubscribedToSubredditListener.isSubscribed();