Closed shivanigangadharan closed 4 years ago
Apart of the code segment you added, there is a lot for formatting done, can you please remove it @shivanigangadharan ? (may be add a commit to do so).
Apart of the code segment you added, there is a lot for formatting done, can you please remove it @shivanigangadharan ? (may be add a commit to do so).
Okay sure I'll do that and add a commit for the same. Thank you :)
One more comment. This is a cool feature to add. But I don't think the code you wrote can solve the complete problem. Your code can solve it partially. Eg:
It would be better if you can navigate to previous user on clicking back. This can be a bit difficult because all the users have the common URL. The page is getting updated through AJAX requests. Can you index users as 1, 2 .. so on if possible ?
If you want to do the specified change, please don't add it in this PR. As specified in above comment. Remove the formatting. I will merge this. You can create another PR for feature I specifed here.
@rammanoj You're right, now I understand what will happen when we create the query with two users, it will keep directing to the home page only. I have removed the formatting changes here, so you may merge this PR. I'll also create a new PR after working on the feature by indexing users as you mentioned. Thank you very much for your guidance.
Thanks @shivanigangadharan for submitting this PR! I'm going to merge this now. If you would like to work on @rammanoj's proposed changes, you may submit a new PR :)
@srish As you mentioned, I tried using only the history.push() function and realised there isn't a need for the onpopstate event. So I have made the change in line 11 of the code. Please ignore the rest of the changes that are shown below, it's all just formatting edits that were automatically done by Prettify installed in my system.