Closed r06942072 closed 5 years ago
Ref:
legacy BLAST looks like using a sessionStorage, but "localStorage + popupbox" is better if the user accidentially close the window during working.
Ref:
related issue on gitlab:
Legacy BLAST can save data
https://gitlab.com/i5k_Workspace/workspace_roadmap/issues/119
BLAST query page design
https://gitlab.com/i5k_Workspace/workspace_roadmap/issues/376
User feedback (from Hugh) on django-blast interface
https://gitlab.com/i5k_Workspace/workspace_roadmap/issues/793
https://gitlab.com/i5k_Workspace/workspace_roadmap/issues/795
take legacy blast as a good example
keyword: window.localStorage
step1. store.subscribe(localStorage.setItem(.....))
add localStorage code in store subscribe(listener), whenever the reduxstate change, save the latest reduxstate in the localStorage as the datatype string and as a variable named 'reduxState'
step2. (localStorage.getItem(.....))
If the localStorage is not empty, then load initial state from it
step3. fetchList()
is defined in actions/
If the localStorage is empty(which means that the user open the BLAST form the very first time), fetch the data from remote url
FYI, on chrome browser
localStorage
localStorage.clear()
if want to clear it to null
from results page back to submission page We want the state still preserve.