Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions webview-ui/src/components/welcome/RooTips.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,21 @@ const RooTips = ({ cycle = false }: RooTipsProps) => {
useEffect(() => {
if (!cycle) return

let timeoutId: NodeJS.Timeout | undefined = undefined
const intervalId = setInterval(() => {
setIsFading(true) // Start fade out
setTimeout(() => {
timeoutId = setTimeout(() => {
setCurrentTipIndex((prevIndex) => (prevIndex + 1) % tips.length)
setIsFading(false) // Start fade in
}, 1000) // Fade duration
}, 11000) // 10s display + 1s fade

return () => clearInterval(intervalId) // Cleanup on unmount
return () => {
clearInterval(intervalId)
if (timeoutId) {
clearTimeout(timeoutId)
}
}
}, [cycle])

const currentTip = tips[currentTipIndex]
Expand Down
Loading