Skip to content

Commit

Permalink
EBR-91: resolve sonar issue
Browse files Browse the repository at this point in the history
  • Loading branch information
915-Misan-Teodora committed Sep 10, 2024
1 parent c733312 commit d5c3332
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/pyunicoreWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,11 @@ export class PyunicoreComponent extends React.Component<
componentWillUnmount(): void {
const { updateIntervalId } = this.state;

if (typeof updateIntervalId === 'number') {
// in browser envs
clearInterval(updateIntervalId);
} else if (updateIntervalId !== undefined) {
// in Node.js envs
clearInterval(updateIntervalId);
if (
typeof updateIntervalId === 'number' ||
(typeof updateIntervalId === 'object' && updateIntervalId !== null)
) {
clearInterval(updateIntervalId as any);
}
}

Expand Down

0 comments on commit d5c3332

Please sign in to comment.