File tree Expand file tree Collapse file tree 2 files changed +20
-9
lines changed
static/app/components/events/eventReplay Expand file tree Collapse file tree 2 files changed +20
-9
lines changed Original file line number Diff line number Diff line change 1+ import { useEffect } from 'react' ;
12import styled from '@emotion/styled' ;
23
34import { Alert } from 'sentry/components/alert' ;
@@ -79,6 +80,15 @@ function ReplayClipPreviewPlayer({
7980 } ) ;
8081 const organization = useOrganization ( ) ;
8182
83+ useEffect ( ( ) => {
84+ if ( replayReaderResult . fetchError ) {
85+ trackAnalytics ( 'replay.render-missing-replay-alert' , {
86+ organization,
87+ surface : 'issue details - clip preview' ,
88+ } ) ;
89+ }
90+ } , [ organization , replayReaderResult . fetchError ] ) ;
91+
8292 if ( replayReaderResult . replayRecord ?. is_archived ) {
8393 return (
8494 < Alert type = "warning" data-test-id = "replay-error" >
@@ -91,10 +101,6 @@ function ReplayClipPreviewPlayer({
91101 }
92102
93103 if ( replayReaderResult . fetchError ) {
94- trackAnalytics ( 'replay.render-missing-replay-alert' , {
95- organization,
96- surface : 'issue details - clip preview' ,
97- } ) ;
98104 return < MissingReplayAlert orgSlug = { orgSlug } /> ;
99105 }
100106
Original file line number Diff line number Diff line change 11import type { ComponentProps } from 'react' ;
2- import { useMemo } from 'react' ;
2+ import { useEffect , useMemo } from 'react' ;
33import styled from '@emotion/styled' ;
44
55import { Alert } from 'sentry/components/alert' ;
@@ -79,6 +79,15 @@ function ReplayPreview({
7979 event_replay_status : getReplayAnalyticsStatus ( { fetchError, replayRecord} ) ,
8080 } ) ;
8181
82+ useEffect ( ( ) => {
83+ if ( fetchError ) {
84+ trackAnalytics ( 'replay.render-missing-replay-alert' , {
85+ organization,
86+ surface : 'issue details - old preview' ,
87+ } ) ;
88+ }
89+ } , [ organization , fetchError ] ) ;
90+
8291 if ( replayRecord ?. is_archived ) {
8392 return (
8493 < Alert type = "warning" data-test-id = "replay-error" >
@@ -91,10 +100,6 @@ function ReplayPreview({
91100 }
92101
93102 if ( fetchError ) {
94- trackAnalytics ( 'replay.render-missing-replay-alert' , {
95- organization,
96- surface : 'issue details - old preview' ,
97- } ) ;
98103 return < MissingReplayAlert orgSlug = { orgSlug } /> ;
99104 }
100105
You can’t perform that action at this time.
0 commit comments