Fix no multireddits found in MultiredditSelectionActivity in anonymous mode. Do not sync multireddits in anonymous mode in MultiredditSelectionActivity.

This commit is contained in:
Alex Ning 2021-10-16 14:50:18 +08:00
parent 1d7fbe3a99
commit 4395384586
3 changed files with 5 additions and 3 deletions

View File

@ -150,7 +150,9 @@ public class MultiredditSelectionActivity extends BaseActivity implements Activi
return; return;
} }
if (mAccessToken != null) {
loadMultiReddits(); loadMultiReddits();
}
if (initializeFragment) { if (initializeFragment) {
mFragment = new MultiRedditListingFragment(); mFragment = new MultiRedditListingFragment();

View File

@ -398,7 +398,7 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti
SubscribedSubredditsListingFragment fragment = new SubscribedSubredditsListingFragment(); SubscribedSubredditsListingFragment fragment = new SubscribedSubredditsListingFragment();
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putBoolean(SubscribedSubredditsListingFragment.EXTRA_IS_SUBREDDIT_SELECTION, false); bundle.putBoolean(SubscribedSubredditsListingFragment.EXTRA_IS_SUBREDDIT_SELECTION, false);
bundle.putString(SubscribedSubredditsListingFragment.EXTRA_ACCOUNT_NAME, mAccountName == null ? "-" : mAccountName); bundle.putString(SubscribedSubredditsListingFragment.EXTRA_ACCOUNT_NAME, mAccountName);
bundle.putString(SubscribedSubredditsListingFragment.EXTRA_ACCESS_TOKEN, mAccessToken); bundle.putString(SubscribedSubredditsListingFragment.EXTRA_ACCESS_TOKEN, mAccessToken);
fragment.setArguments(bundle); fragment.setArguments(bundle);
return fragment; return fragment;

View File

@ -108,7 +108,7 @@ public class MultiRedditListingFragment extends Fragment implements FragmentComm
} }
} }
String accountName = getArguments().getString(EXTRA_ACCOUNT_NAME); String accountName = getArguments().getString(EXTRA_ACCOUNT_NAME, "-");
String accessToken = getArguments().getString(EXTRA_ACCESS_TOKEN); String accessToken = getArguments().getString(EXTRA_ACCESS_TOKEN);
boolean isGettingMultiredditInfo = getArguments().getBoolean(EXTRA_IS_GETTING_MULTIREDDIT_INFO, false); boolean isGettingMultiredditInfo = getArguments().getBoolean(EXTRA_IS_GETTING_MULTIREDDIT_INFO, false);