Skip to content

Commit

Permalink
fix: Return 0 instead of error when no defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
mrv777 committed Oct 11, 2024
1 parent 33a7c57 commit 867e797
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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.0"
"version": "0.1.1"
},
"tauri": {
"allowlist": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const Header: React.FC<HeaderProps> = () => {
<path strokeLinecap="round" strokeLinejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99" />
</svg>
</button>
<button onClick={resetLocalStorage} className="btn btn-ghost btn-circle tooltip tooltip-left flex items-center justify-center" data-tip="Reset Local Storage">
<button onClick={resetLocalStorage} className="btn btn-ghost btn-circle tooltip tooltip-left flex items-center justify-center" data-tip="Reset Everything">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="red" className="w-5 h-5">
<path strokeLinecap="round" strokeLinejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" />
</svg>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/asicDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const coreVoltageOptions: Record<string, DropdownOption[]> = {
export function getDefaultFrequency(model: string): number {
const options = frequencyOptions[model];
if (!options) {
throw new Error(`No frequency options found for model ${model}`);
return 0;
}
const defaultOption = options.find(option => option.name.includes('default'));
return defaultOption ? defaultOption.value : options[0].value;
Expand All @@ -106,7 +106,7 @@ export function getDefaultFrequency(model: string): number {
export function getDefaultCoreVoltage(model: string): number {
const options = coreVoltageOptions[model];
if (!options) {
throw new Error(`No core voltage options found for model ${model}`);
return 0;
}
const defaultOption = options.find(option => option.name.includes('default'));
return defaultOption ? defaultOption.value : options[0].value;
Expand Down

0 comments on commit 867e797

Please sign in to comment.