Folders no longer appear in alphabetical order until dragging one of them

When I first load NewsBlur into a new tab, my folders appear in close-to-but-not-quite alphabetical order:
YouTube
Comics


TV
Gaming

I can fix it by just dragging any folder by one spot and the whole list corrects itself. This isn’t a critical issue but I thought you should be aware. It repros across multiple computers and through refreshes so it’s not likely to be a caching issue.

Account: Laptop765

1 Like

I think I found the problem. In reader.js, the sort_items function has the following code:

else if (!feedA && !feedB && a && b && !_.isNumber(a) && !_.isNumber(b) && !(a.e instanceof jQuery) && (!b.e instanceof jQuery))

The current version on the site is actually lacking parens around the !b.e instanceof jQuery. I see that you’ve added it in the repository, but they still look misplaced. I think you meant to include the ! outside of the parens like they are for the a.e instanceof jQuery check. Do note this check appears in both the ALPHABETICAL and MOSTUSED if branches and needs to be fixed in both places.

Without this fix, the sort comparison returns “undefined” instead of “1” for a comparison of “YouTube” and “Gaming” which causes things to not be in order.

Hope this helps! I look forward to seeing the fix soon =)

Holy cow, great find! I’d be thrilled to include this, but I’d be much, MUCH happier if you submit it as a pull request. Just go here and change the offending two lines: https://github.com/samuelclay/NewsBlu…. You can edit the file at top, and it will be automatically submitted as a pull request.

I’d like to test it out on GitHub to increase engagement in the code.

Done. I was actually wondering how to do that when I found the bug, but I’ve never used Git nor GitHub before. Thanks!

This has now been merged successfully and deployed. Thanks Paul!

Looks great, thanks for taking the fix!