Description
copyToClipboard sets copied=true and then schedules setTimeout(() => setCopied(false), 50000). There is no cleanup when the component unmounts or when a subsequent copy happens quickly—leading to:
“Copied” badge potentially turning off at unexpected times
timers lingering after navigation
Steps to Reproduce
Click “Copy Link” multiple times quickly.
Navigate away from the page within ~1 minute.
Return back to the page (or observe in React devtools).
Expected Behavior
“Copied” should:
only reflect the latest copy action
clear timers on unmount
never cause delayed state changes after navigation
Screenshots / Logs
No response
GitHub Username (If applicable)
No response
Environment
Chrome
Description
copyToClipboard sets copied=true and then schedules setTimeout(() => setCopied(false), 50000). There is no cleanup when the component unmounts or when a subsequent copy happens quickly—leading to:
“Copied” badge potentially turning off at unexpected times
timers lingering after navigation
Steps to Reproduce
Click “Copy Link” multiple times quickly.
Navigate away from the page within ~1 minute.
Return back to the page (or observe in React devtools).
Expected Behavior
“Copied” should:
only reflect the latest copy action
clear timers on unmount
never cause delayed state changes after navigation
Screenshots / Logs
No response
GitHub Username (If applicable)
No response
Environment
Chrome