File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
static/app/views/releases/utils Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1+ import { useEffect , useRef } from 'react' ;
2+ import { logger } from '@sentry/react' ;
3+
4+ import type { Project } from 'sentry/types/project' ;
15import type { Deploy } from 'sentry/types/release' ;
26import { useApiQuery } from 'sentry/utils/queryClient' ;
37import useOrganization from 'sentry/utils/useOrganization' ;
@@ -12,12 +16,24 @@ export function useReleaseDeploys({
1216} ) {
1317 const organization = useOrganization ( ) ;
1418 const project = useProjectFromSlug ( { organization, projectSlug} ) ;
19+ const prevProject = useRef < Project | undefined > ( undefined ) ;
20+
21+ useEffect ( ( ) => {
22+ if ( ! project ) {
23+ logger . warn ( 'Release: project undefined in useReleaseDeploys' , { projectSlug} ) ;
24+ }
25+ if ( project && ! prevProject . current ) {
26+ logger . warn ( 'Release: project is now defined in useReleaseDeploys' , { projectSlug} ) ;
27+ }
28+ prevProject . current = project ;
29+ } , [ project , projectSlug ] ) ;
30+
1531 return useApiQuery < Deploy [ ] > (
1632 [
1733 `/organizations/${ organization . slug } /releases/${ encodeURIComponent ( release ) } /deploys/` ,
1834 {
1935 query : {
20- project : project ! . id , // Should be disabled if project is undefined
36+ project : project ? .id , // Should be disabled if project is undefined
2137 } ,
2238 } ,
2339 ] ,
You can’t perform that action at this time.
0 commit comments