Slide: /r/random sidebar is from a different random sub than the one displayed

Created on 9 Mar 2016  Â·  13Comments  Â·  Source: ccrama/Slide

Slide version: 70a60a0186e13709e5da2b8bc58f550dc14a13cf
Android version: 5.1.1

Edit: So the same would also be true for randnsfw

Bug

Most helpful comment

I think the first snippet should, because it access the posts object that has a posts list.
The second one would def throw an exception for a subreddit with 0 posts.

All 13 comments

The problem is this:
The string value is "random" and thus the app asks reddit for the sidebar to "random" sub and that's why it is different.

So that same issue happens here when you ask for a different sort.
Fix by simply getting the subreddit name from the posts on the onCreate method.

So doing
subreddit = ((SubmissionsView) adapter.getCurrentFragment()).posts.subreddit;
Unless that also takes it from that first variable. Then it should be something like:
subreddit = ((SubmissionsView) adapter.getCurrentFragment()).posts.posts.get(0).getSubredditName();
Before calling doSubSidebar(subreddit); Should work

Should be preserved somewhere though (maybe a flag). because I think refreshing should change the subreddit if it was random.

I don't think your code snippet will work for subreddits with 0 posts, correct?

I think the first snippet should, because it access the posts object that has a posts list.
The second one would def throw an exception for a subreddit with 0 posts.

In addition to this, when submitting to /r/random, the 'Subreddit' edittext should be autofilled with the current random subreddit name (instead of 'random'/'randnsfw').

Fixed now!

I think this issue should be reopened, it seems like you fixed it for /r/random but not /r/randnsfw. The sidebar/subreddit edittext both display different subreddit info than the actual subreddit. So to clarify, if the randnsfw subreddit is X, the sidebar and subreddit edittext both display a subreddit Y (the same, yet different sub).

Is randnsfw a thing? Haven't heard of that before

Yes, it basically opens up a random nsfw subreddit.

There's also /r/myrandom

Added nsfwrandom and myrandom

Looks like this issue reappeared at some point.

Slide version: 6.2 (F-Droid)
Android version: Q Beta 5

For which sub @dpeukert - e.g. random, nsfwrand, myrandom?

I was able to reproduce this with random and nsfwrand (myrandom seems to be
a Reddit Premium only feature).

On Mon, 29 Jul 2019, 16:26 Alex Macleod, notifications@github.com wrote:

For which sub @dpeukert https://github.com/dpeukert - e.g. random,
nsfwrand, myrandom?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ccrama/Slide/issues/1165?email_source=notifications&email_token=AA2KYAANRV77IB26IAEVEE3QB34ZDA5CNFSM4B5SYXQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3A4CUQ#issuecomment-516014418,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA2KYACPYR3CKX435U7Y443QB34ZDANCNFSM4B5SYXQQ
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

najodleglejszy picture najodleglejszy  Â·  5Comments

prashantkhurana picture prashantkhurana  Â·  6Comments

goodpricefriedrice picture goodpricefriedrice  Â·  6Comments

SaladMandrake picture SaladMandrake  Â·  3Comments

Nxt3 picture Nxt3  Â·  3Comments