Refactor lets to consts

This commit is contained in:
James Whitmarsh 2023-06-05 22:31:12 +01:00
parent 400e62b21c
commit 0754b9ba19
50 changed files with 734 additions and 727 deletions

View file

@ -31,12 +31,12 @@ export class LanguageSelect extends Component<LanguageSelectProps, any> {
// Necessary because there is no HTML way to set selected for multiple in value=
setSelectedValues() {
let ids = this.props.selectedLanguageIds?.map(toString);
const ids = this.props.selectedLanguageIds?.map(toString);
if (ids) {
let select = (document.getElementById(this.id) as HTMLSelectElement)
const select = (document.getElementById(this.id) as HTMLSelectElement)
.options;
for (let i = 0; i < select.length; i++) {
let o = select[i];
const o = select[i];
if (ids.includes(o.value)) {
o.selected = true;
}
@ -130,8 +130,8 @@ export class LanguageSelect extends Component<LanguageSelectProps, any> {
}
handleLanguageChange(i: LanguageSelect, event: any) {
let options: HTMLOptionElement[] = Array.from(event.target.options);
let selected: number[] = options
const options: HTMLOptionElement[] = Array.from(event.target.options);
const selected: number[] = options
.filter(o => o.selected)
.map(o => Number(o.value));