Skip to content

Fix duplicate history entry on selecting lines

Warren Gifford requested to merge fkling/blob-fix-duplicate-history-entry into main

Created by: fkling

It appears that we are adding the exact same history entry twice, making the back and forward buttons behave unexpectedly: The first time the back button is clicked nothing seems to happen:

https://user-images.githubusercontent.com/179026/177218213-8b5b2c1c-0a56-49b3-a4f5-864f0f308290.mp4

Both the function this line was delete from as well as the observable that gets triggered by calling nextPopOverClose add a history entry. I believe calling nextPopOverClose is unncessary here (or we leave it but remove the call to history.push(...) below).

Test plan

  • Open a file in Sourcegraph and select various lines in the file
  • Press the back button. Every press should jump to a different location.

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading