Skip to content

Commit

Permalink
fix: Correct default check with linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mrv777 committed Oct 11, 2024
1 parent dd5b80a commit ffe8fb3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bithive",
"version": "0.1.1",
"version": "0.1.2",
"private": true,
"author": {
"name": "MrV",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "BitHive",
"version": "0.1.1"
"version": "0.1.2"
},
"tauri": {
"allowlist": {
Expand Down
10 changes: 6 additions & 4 deletions src/lib/asicDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,15 @@ export const coreVoltageOptions: Record<string, DropdownOption[]> = {
};

export function getDefaultFrequency(model: string): number {
const options = frequencyOptions[model];
const options = frequencyOptions[model] as DropdownOption[] | undefined;
if (!options) return 0;
const defaultOption = options.find(option => option.name.includes('default'));
return defaultOption ? defaultOption.value : options[0]?.value || 0;
return defaultOption ? defaultOption.value : options[0]?.value ?? 0;
}

export function getDefaultCoreVoltage(model: string): number {
const options = coreVoltageOptions[model];
const options = coreVoltageOptions[model] as DropdownOption[] | undefined;
if (!options) return 0;
const defaultOption = options.find(option => option.name.includes('default'));
return defaultOption ? defaultOption.value : options[0]?.value || 0;
return defaultOption ? defaultOption.value : options[0]?.value ?? 0;
}

0 comments on commit ffe8fb3

Please sign in to comment.