File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,13 @@ export const LogsSection = observer(({ rolloutId }: LogsSectionProps) => {
1616 const [ isExpanded , setIsExpanded ] = useState ( false ) ;
1717 const [ selectedLevel , setSelectedLevel ] = useState < string > ( "" ) ;
1818
19- const fetchLogs = async ( ) => {
19+ const fetchLogs = async ( isInitialLoad = false ) => {
2020 if ( ! rolloutId ) return ;
2121
22- setLoading ( true ) ;
22+ // Only show loading on initial load, not during polling
23+ if ( isInitialLoad ) {
24+ setLoading ( true ) ;
25+ }
2326 setError ( null ) ;
2427
2528 try {
@@ -98,8 +101,8 @@ export const LogsSection = observer(({ rolloutId }: LogsSectionProps) => {
98101
99102 useEffect ( ( ) => {
100103 if ( isExpanded && rolloutId ) {
101- fetchLogs ( ) ; // Initial load
102- const interval = setInterval ( fetchLogs , 5000 ) ; // Poll every 5 seconds
104+ fetchLogs ( true ) ; // Initial load
105+ const interval = setInterval ( ( ) => fetchLogs ( false ) , 5000 ) ; // Poll every 5 seconds without loading state
103106 return ( ) => clearInterval ( interval ) ;
104107 }
105108 } , [ isExpanded , rolloutId , selectedLevel ] ) ;
@@ -152,7 +155,7 @@ export const LogsSection = observer(({ rolloutId }: LogsSectionProps) => {
152155 < option value = "ERROR" > ERROR</ option >
153156 </ Select >
154157 < Button
155- onClick = { fetchLogs }
158+ onClick = { ( ) => fetchLogs ( true ) }
156159 variant = "primary"
157160 size = "sm"
158161 disabled = { loading }
You can’t perform that action at this time.
0 commit comments