linting cleanup

This commit is contained in:
Matt Walsh
2024-10-21 19:21:05 -05:00
parent 487c83f664
commit e2d7a96971
8 changed files with 893 additions and 577 deletions

View File

@@ -39,14 +39,14 @@ const fetchAsync = async (_url, responseType, _params = {}) => {
if (!response.ok) throw new Error(`Fetch error ${response.status} ${response.statusText} while fetching ${response.url}`);
// return the requested response
switch (responseType) {
case 'json':
return response.json();
case 'text':
return response.text();
case 'blob':
return response.blob();
default:
return response;
case 'json':
return response.json();
case 'text':
return response.text();
case 'blob':
return response.blob();
default:
return response;
}
};
@@ -84,11 +84,11 @@ const delay = (time, func, ...args) => new Promise((resolve) => {
const retryDelay = (retryNumber) => {
switch (retryNumber) {
case 1: return 1000;
case 2: return 2000;
case 3: return 5000;
case 4: return 10_000;
default: return 30_000;
case 1: return 1000;
case 2: return 2000;
case 3: return 5000;
case 4: return 10_000;
default: return 30_000;
}
};

View File

@@ -33,12 +33,12 @@ class Setting {
// call the change function on startup
switch (type) {
case 'select':
this.selectChange({ target: { value: this.myValue } });
break;
case 'checkbox':
default:
this.checkboxChange({ target: { checked: this.myValue } });
case 'select':
this.selectChange({ target: { value: this.myValue } });
break;
case 'checkbox':
default:
this.checkboxChange({ target: { checked: this.myValue } });
}
}
@@ -129,12 +129,12 @@ class Setting {
const storedValue = JSON.parse(allSettings)?.[this.shortName];
if (storedValue !== undefined) {
switch (this.type) {
case 'boolean':
return storedValue;
case 'select':
return storedValue;
default:
return null;
case 'boolean':
return storedValue;
case 'select':
return storedValue;
default:
return null;
}
}
}
@@ -152,12 +152,12 @@ class Setting {
// update the state
this.myValue = newValue;
switch (this.type) {
case 'select':
this.selectHighlight(newValue);
break;
case 'checkbox':
default:
this.element.checked = newValue;
case 'select':
this.selectHighlight(newValue);
break;
case 'checkbox':
default:
this.element.checked = newValue;
}
this.storeToLocalStorage(this.myValue);
@@ -174,11 +174,11 @@ class Setting {
generate() {
switch (this.type) {
case 'select':
return this.generateSelect();
case 'checkbox':
default:
return this.generateCheckbox();
case 'select':
return this.generateSelect();
case 'checkbox':
default:
return this.generateCheckbox();
}
}
}