Uploaded image for project: 'BookBrainz'
  1. BookBrainz
  2. BB-610

In collections page, entity type URL parameters don't work on refresh or navigation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • None
    • Site Interface
    • None

      Go to https://bookbrainz.org/collections?size=20&from=0 ,

      try switching entity type to some entity lets say "author" and now just refresh the page ,wolla!,  you will see the last selected "entity type" has been lost.

       I have attached a video tutorial for the same : 

      Problems caused due to this implications :

      Now After Refreshing if you select "All Types " , nothing will happen simply because the state "type"  is now  " " and pager Element will restrict any searchTrigger due to these line of code 

      https://github.com/bookbrainz/bookbrainz-site/blob/c908c2135aaed62c7448977a74ece5c6fd462524/src/client/components/pages/parts/pager.js#L99

       

      I have two solution for this:

       

      1(easy one ) :

      save the "type" state of collection-table https://github.com/bookbrainz/bookbrainz-site/blob/c908c2135aaed62c7448977a74ece5c6fd462524/src/client/components/pages/parts/collections-table.js#L36 

      to localStorage on componentWillUnmount and restore it in componentDidMount method.

       

      2(good one)

      Use Redux to store this state and hence any refresh will persist the state. 

      The problem is,  the codebase used redux store for entity-editor only but it should be central , so if we intend to use redux we have to make another store which is kind of less appreciated than to centralise the current redux implementation .

       

       

            shubh Shubham
            endurance21 Divyanshu Raj
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package