javascript go back and get previous page FINAL STATE

405 views Asked by At

I am building a page that retrieves some Github repositories and then displays a punchcard chart with the data returned by the API (sorry for the screenshots in advance, but I was having trouble with the in-built code styling). I start with a semi-empty html page and I build stuff as I get the info from the API calls.

  1. Firstly, the user logs in to get all their repos, but I don't store information about it, I just pass their credentials in the header (app.js)

fetchRepositories

  1. Then, with the response I paint a list of all the repos (app.js).

list repos

  1. When clicked in one repo, a new html is load, and has js that calls the Github API to retrieve the punchcard and paint the charts (repo.js).

enter image description here enter image description here enter image description here

What I need to accomplish is that, if while being in that second html I click on the goBack button, I go back to the previous page, but having the repo list already painted there. Is there any way I can do it without having to log in (do it all over) again?

The app is deployed here, and all the code can be found here.

Thanks for the help.

0

There are 0 answers