mirror of
https://github.com/wassname/talk.git
synced 2026-06-29 05:18:32 +08:00
Clearing the timeout
This commit is contained in:
@@ -48,7 +48,7 @@ export default class PermalinkButton extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
this.timeout = window.setTimeout(() => {
|
||||
this.setState({
|
||||
copyFailure: null,
|
||||
copySuccessful: null
|
||||
@@ -56,6 +56,10 @@ export default class PermalinkButton extends React.Component {
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.clearTimeout(this.timeout);
|
||||
}
|
||||
|
||||
render () {
|
||||
const {copySuccessful, copyFailure, popoverOpen} = this.state;
|
||||
const {asset} = this.props;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
display: none;
|
||||
background-color: white;
|
||||
position: absolute;
|
||||
|
||||
border-radius: 3px;
|
||||
padding: 15px 10px;
|
||||
box-sizing: border-box;
|
||||
|
||||
Reference in New Issue
Block a user