Skip to content

Code Insights: Fix `hasInsights` api method and therefore smart redirect for the main insight page

Warren Gifford requested to merge vk/fix-smart-redirect-insight-main-page into main

Created by: vovakulikov

Closes https://github.com/sourcegraph/sourcegraph/issues/32387

Test plan

  • Check that if you have at least one available to you insight you see the dashboard page when you click on the global nav item "Insights"
  • Check that you don't have any available insights you should have been redirected to the getting started page

How did we miss this

Prior to this PR, we did rely on the page info object to determine do users have available to their insights or not. It always returns has next page and therefore we always saw redirections to the dashboard page. It has been fixed in this PR https://github.com/sourcegraph/sourcegraph/pull/30086 and now everything works as it should but it broke bad FE logic.

Merge request reports

Loading