mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-14 15:49:31 -07:00
linting cleanup
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user