Browse Source

fix(replays): fix display of selector widgets if no proj selected (#67356)

Fixing a small bug that was hiding the selector widgets if all/no
projects were selected:


https://github.com/getsentry/sentry/assets/56095982/16c7de04-fe14-40ec-959e-a7354bc2bf47
Michelle Zhang 11 months ago
parent
commit
c7c786b04a
1 changed files with 5 additions and 1 deletions
  1. 5 1
      static/app/views/replays/detail/useAllMobileProj.tsx

+ 5 - 1
static/app/views/replays/detail/useAllMobileProj.tsx

@@ -11,9 +11,13 @@ export default function useAllMobileProj() {
 
   const {projects} = useProjects();
   const projectsSelected = projects.filter(p => projectIds.map(String).includes(p.id));
+
+  // if no projects selected, look through all projects
+  const proj = projectsSelected.length ? projectsSelected : projects;
+
   const allMobileProj =
     organization.features.includes('session-replay-mobile-player') &&
-    projectsSelected.every(p => mobile.includes(p.platform ?? 'other'));
+    proj.every(p => mobile.includes(p.platform ?? 'other'));
 
   return {allMobileProj};
 }