Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/PresetSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default function PresetSelector({ recipe, onChange }: Props) {

const handleWidthChange = useCallback(
(width: number) => {
if (!isNaN(width) && width >= 16 && width <= 7680) {
if (!Number.isNaN(width) && width >= 16 && width <= 7680) {
onChange({ customWidth: width });
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/TrimControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default function TrimControl({ recipe, onChange, duration, file }: Props)

const n = parseFloat(val);

if (isNaN(n)) {
if (Number.isNaN(n)) {
setStart(true);
setStartErrorMsg("Enter a valid number.");
return;
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useKeyboardShortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function useKeyboardShortcuts({

default:
if (e.key >= "1" && e.key <= "9") {
const index = parseInt(e.key) - 1;
const index = parseInt(e.key, 10) - 1;
if (PRESETS[index]) {
updateRecipe({ preset: PRESETS[index].id });
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/exportEstimate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export function formatEstimatedSize(sizeMb: number): string {
return `~${(sizeMb / 1024).toFixed(1)} GB`;
}
if (sizeMb < 1) {
return `~${Math.round(sizeMb * 1024)} KB`;
return `~${Math.round(sizeMb * 1024 + Number.EPSILON)} KB`;
}
return `~${sizeMb.toFixed(1)} MB`;
}