Skip to content

Commit af0a90e

Browse files
committed
Lint fixes
1 parent 7b43022 commit af0a90e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

webview-ui/src/components/cloud/CloudView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export const CloudView = ({ userInfo, isAuthenticated, cloudApiUrl, onDone, orga
274274

275275
{/* Usage Stats Chart Section */}
276276
<div className="mt-4 mb-4 px-4">
277-
<UsagePreview cloudApiUrl={cloudApiUrl} onViewDetails={handleViewUsageStats} />
277+
<UsagePreview onViewDetails={handleViewUsageStats} />
278278
</div>
279279

280280
<div className="flex flex-col gap-2 mt-4 px-4">

webview-ui/src/components/cloud/UsagePreview.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ export const UsagePreview = ({ onViewDetails }: UsagePreviewProps) => {
105105
}, []) // eslint-disable-line react-hooks/exhaustive-deps
106106

107107
const getBarHeight = (cost: number): number => {
108+
if (!data || !data.days || data.days.length === 0) return 1
108109
const maxCost = Math.max(...data.days.map((d) => d.cost))
109-
return Math.max(1, ~~(cost / maxCost) * 100) // Avoid NaN and enforce minimum 10% height for visibility
110+
return Math.max(1, ~~(cost / maxCost) * 100) // Avoid NaN and enforce minimum height for visibility
110111
}
111112

112113
// Retry loading

0 commit comments

Comments
 (0)