lemmy-ui icon indicating copy to clipboard operation
lemmy-ui copied to clipboard

Homepage showing 'All' posts when 'Local' is selected

Open ruudschilders opened this issue 1 year ago • 4 comments

I have 0.17.3 installed. (https://lemmy.world) When I login, I am redirected to the homepage. It shows 'Local' posts are selected, but I see 'All' posts. When I click 'All' and then back to 'Local' , it does show Local posts only.

Also when going back from another page, like Communities, to the homepage I see this behaviour. I don't see it when not logged in.

ruudschilders avatar Jun 02 '23 18:06 ruudschilders

Update: Apparently this only happens when in user settings, 'Type' is set to 'All' I am guessing that's the default I would want on the homepage. So explains why I see All. But then the 'All' should be highlighted, not the 'Local'

ruudschilders avatar Jun 03 '23 14:06 ruudschilders

Tried it on lemmy.ml and it doesn't have your issue however when I select "All" for "Type" in Settings it shows me the "Local" tab by default on the homepage and it's filtered properly

exadeci avatar Jun 05 '23 07:06 exadeci

Verified. Might be a while until I can get to this one.

dessalines avatar Jun 05 '23 17:06 dessalines

I think this is already fixed and will be released with v0.18, although I can't verify it (having trouble running the latest main locally).

In v0.17 there was a weak conditional operator that erroneously handled the setting 'show All posts' (value 0) as if there was no setting at all (value undefined) – see utils.ts#L739:

myLt    // will be 0 if the user has selected 'All' in their settings
    ? Object.values(ListingType)[myLt]
    : defaultListingType;

This code was refactored a few weeks ago and the error should no longer occur. See home.tsx#L115.

Will test once 0.18 is released/fully working.

fheft avatar Jun 10 '23 11:06 fheft