-
Notifications
You must be signed in to change notification settings - Fork 3
fix: remove void operators and unnecessary awaits (SonarCloud) #386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -171,13 +171,13 @@ export function PerformanceDashboard() { | |
|
|
||
| // Initial fetch | ||
| useEffect(() => { | ||
| void fetchData(); | ||
| fetchData(); | ||
| return () => abortRef.current?.abort(); | ||
|
Comment on lines
173
to
175
|
||
| }, [fetchData]); | ||
|
|
||
| // Auto-refresh every 30s | ||
| useEffect(() => { | ||
| const id = window.setInterval(() => void fetchData(true), AUTO_REFRESH_MS); | ||
| const id = window.setInterval(() => fetchData(true), AUTO_REFRESH_MS); | ||
| return () => window.clearInterval(id); | ||
| }, [fetchData]); | ||
|
|
||
|
|
@@ -209,7 +209,7 @@ export function PerformanceDashboard() { | |
| } | ||
| setThresholdMsg('Thresholds saved.'); | ||
| toast.success('Thresholds saved', { description: 'Alert thresholds updated successfully.' }); | ||
| void fetchData(true); | ||
| fetchData(true); | ||
| } catch { | ||
| setThresholdMsg('Error: Network failure'); | ||
| toast.error('Failed to save thresholds', { description: 'A network error occurred.' }); | ||
|
|
@@ -271,7 +271,7 @@ export function PerformanceDashboard() { | |
| variant="outline" | ||
| size="sm" | ||
| className="gap-2" | ||
| onClick={() => void fetchData()} | ||
| onClick={() => fetchData()} | ||
| disabled={loading} | ||
| > | ||
| <RefreshCw className={`h-4 w-4 ${loading ? 'animate-spin' : ''}`} /> | ||
|
|
@@ -286,7 +286,7 @@ export function PerformanceDashboard() { | |
| className="rounded-md border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive" | ||
| > | ||
| <strong>Failed to load performance data:</strong> {error} | ||
| <Button variant="outline" size="sm" className="ml-4" onClick={() => void fetchData()}> | ||
| <Button variant="outline" size="sm" className="ml-4" onClick={() => fetchData()}> | ||
| Try again | ||
| </Button> | ||
| </div> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR description indicates
voidoperators were removed from dashboard components, but this file still hasvoid (async () => { ... })()in the channels-fetch effect (around line 176). Consider removing that remainingvoidusage as well (or clarify why it’s intentionally kept) to avoid leaving SonarCloud issues behind.