diff options
author | Alex Ning <chineseperson5@gmail.com> | 2020-12-26 14:23:33 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2020-12-26 14:23:33 +0000 |
commit | bb3f76c9655ff3740816fc926d7d16539c9621a1 (patch) | |
tree | c209dc30ce8a2e1966f674c227e7695b702b7df8 /app/src/main/java/ml | |
parent | 196219ba010c01eeaeb936d6680b4f4e085d1d3c (diff) | |
download | infinity-for-reddit-bb3f76c9655ff3740816fc926d7d16539c9621a1.tar infinity-for-reddit-bb3f76c9655ff3740816fc926d7d16539c9621a1.tar.gz infinity-for-reddit-bb3f76c9655ff3740816fc926d7d16539c9621a1.tar.bz2 infinity-for-reddit-bb3f76c9655ff3740816fc926d7d16539c9621a1.tar.lz infinity-for-reddit-bb3f76c9655ff3740816fc926d7d16539c9621a1.tar.xz infinity-for-reddit-bb3f76c9655ff3740816fc926d7d16539c9621a1.tar.zst infinity-for-reddit-bb3f76c9655ff3740816fc926d7d16539c9621a1.zip |
Fix issues in resepecting subreddit recommended comment sort type.
Diffstat (limited to '')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java index 43462cc5..386f15cd 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java @@ -505,9 +505,7 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS } mMessageFullname = getIntent().getStringExtra(EXTRA_MESSAGE_FULLNAME); mNewAccountName = getIntent().getStringExtra(EXTRA_NEW_ACCOUNT_NAME); - } - if (savedInstanceState == null) { if (!mRespectSubredditRecommendedSortType || isSingleCommentThreadMode) { sortType = mSortTypeSharedPreferences.getString(SharedPreferencesUtils.SORT_TYPE_POST_COMMENT, SortType.Type.BEST.value.toUpperCase()); if (sortType != null) { @@ -937,7 +935,7 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS mToolbar.setTitle(new SortType(SortType.Type.valueOf(ViewPostDetailActivity.this.sortType)).getType().fullName); ViewPostDetailActivity.this.sortType = ViewPostDetailActivity.this.sortType.toLowerCase(); } - fetchComments(changeRefreshState, checkSortState, sortType); + fetchComments(changeRefreshState, checkSortState, ViewPostDetailActivity.this.sortType); } else { ViewPostDetailActivity.this.sortType = subredditData.getSuggestedCommentSort(); String sortTypeTemp = ViewPostDetailActivity.this.sortType.toLowerCase().substring(0, 1).toUpperCase() + ViewPostDetailActivity.this.sortType.substring(1); @@ -1825,10 +1823,9 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS children.clear(); } this.sortType = sortType.getType().value; - if (!mRespectSubredditRecommendedSortType) { + if (!mSharedPreferences.getBoolean(SharedPreferencesUtils.RESPECT_SUBREDDIT_RECOMMENDED_COMMENT_SORT_TYPE, false)) { mSortTypeSharedPreferences.edit().putString(SharedPreferencesUtils.SORT_TYPE_POST_COMMENT, sortType.getType().name()).apply(); } - mRespectSubredditRecommendedSortType = false; fetchCommentsRespectRecommendedSort(false, false, sortType.getType().value); mToolbar.setTitle(sortType.getType().fullName); |