mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 04:37:25 +01:00
This commit is contained in:
parent
fbc0006a4f
commit
4b3e11c62d
@ -93,6 +93,9 @@ public class FilteredPostsActivity extends BaseActivity implements SortTypeSelec
|
||||
@Named("current_account")
|
||||
SharedPreferences mCurrentAccountSharedPreferences;
|
||||
@Inject
|
||||
@Named("nsfw_and_spoiler")
|
||||
SharedPreferences mNsfwAndSpoilerSharedPreferences;
|
||||
@Inject
|
||||
CustomThemeWrapper mCustomThemeWrapper;
|
||||
@Inject
|
||||
Executor mExecutor;
|
||||
@ -156,6 +159,7 @@ public class FilteredPostsActivity extends BaseActivity implements SortTypeSelec
|
||||
postType = getIntent().getIntExtra(EXTRA_POST_TYPE, PostPagingSource.TYPE_FRONT_PAGE);
|
||||
int filter = getIntent().getIntExtra(EXTRA_FILTER, -1000);
|
||||
PostFilter postFilter = new PostFilter();
|
||||
postFilter.allowNSFW = !mSharedPreferences.getBoolean(SharedPreferencesUtils.DISABLE_NSFW_FOREVER, false) && mNsfwAndSpoilerSharedPreferences.getBoolean((mAccountName == null || mAccountName.equals("-") ? "" : mAccountName) + SharedPreferencesUtils.NSFW_BASE, false);
|
||||
switch (filter) {
|
||||
case Post.NSFW_TYPE:
|
||||
postFilter.onlyNSFW = true;
|
||||
|
@ -1629,7 +1629,6 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
|
||||
@Override
|
||||
public void changePostFilter(PostFilter postFilter) {
|
||||
this.postFilter = postFilter;
|
||||
postFilter.allowNSFW = !mSharedPreferences.getBoolean(SharedPreferencesUtils.DISABLE_NSFW_FOREVER, false) && mNsfwAndSpoilerSharedPreferences.getBoolean((accountName == null || accountName.equals("-") ? "" : accountName) + SharedPreferencesUtils.NSFW_BASE, false);
|
||||
if (mPostViewModel != null) {
|
||||
mPostViewModel.changePostFilter(postFilter);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user