Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

fix bug of refresh from disable refresh to refresh #2274

Merged
merged 2 commits into from
Apr 7, 2020
Merged

fix bug of refresh from disable refresh to refresh #2274

merged 2 commits into from
Apr 7, 2020

Conversation

Lijiaoa
Copy link
Contributor

@Lijiaoa Lijiaoa commented Apr 7, 2020

No description provided.

} else if (this.timerId !== null && interval === 0) {
window.clearTimeout(this.timerId);
if (this.flag === false) {
this.refresh();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refresh() will setup a (sequence of) timer. If I spam changing interval, there will be bunch of timers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had updated.

@@ -17,7 +17,8 @@ interface AppState {
}

class App extends React.Component<{}, AppState> {
private timerId!: number | null;
private timerId!: number | undefined;
private flag: boolean = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a meaningful name. I can't really understand what this flag does.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@liuzhe-lz liuzhe-lz merged commit 4b598dd into microsoft:v1.5 Apr 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants