uclaradio / uclaradio.com

UCLA Radio Website
http://www.uclaradio.com
GNU Affero General Public License v3.0
31 stars 4 forks source link

Fixes the next button #329

Closed IshaanPota closed 5 years ago

IshaanPota commented 5 years ago

Types of changes

Purpose

Makes sure the next button does not light up when there are no more posts

Approach

The nextIsValid() function only returns true if there are posts left

Learning

Testing

Screenshot(s)

Checklist

Link to Issue

https://github.com/uclaradio/uclaradio.com/issues/298

Platform

Operating System:
Node Version:

Further Comments

tanzeelak commented 5 years ago

I think this broke something in pagination: If I put an empty input in pagination, it should reset to 1 and go back to the first page. I checked tanzeela/blog-cleanup and it still does that. In this fix, it shows up like this:

screen shot 2019-03-06 at 4 09 12 pm
tanzeelak commented 5 years ago

There's another bug introduced: If I search a post, e.g. "joji", and try to change pagination, it shouldn't let me go to a nonexistent page. I checked with tanzeela/blog-cleanup, and it remains at "1" when I put i page that's too large. On this PR, it tries to go to the page and the joji post disappears.

screen shot 2019-03-06 at 4 23 23 pm