Skip to content

Commit

Permalink
client: missing configOpt at input
Browse files Browse the repository at this point in the history
This fixes a JS error when creating an external wallet.
  • Loading branch information
vctt94 authored Oct 31, 2022
1 parent 9e50ede commit ccd5edf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/webserver/site/src/js/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ export class WalletConfigForm {
} else el = this.textInputTmpl.cloneNode(true) as HTMLElement
this.configElements.push([opt, el])
const input = el.querySelector('input') as ConfigOptionInput
input.dataset.configKey = opt.key
input.id = elID
const label = Doc.safeSelector(el, 'label')
label.htmlFor = elID // 'for' attribute, but 'for' is a keyword
Expand Down Expand Up @@ -698,7 +699,8 @@ export class WalletConfigForm {
reorder (box: HTMLElement) {
const inputs: Record<string, HTMLElement[]> = {}
box.querySelectorAll('input').forEach((input: ConfigOptionInput) => {
const k = input.configOpt.key
const k = input.dataset.configKey
if (!k) return // TS2538
const els = []
for (const [opt, el] of this.configElements) if (opt.key === k) els.push(el)
inputs[k] = els
Expand Down

0 comments on commit ccd5edf

Please sign in to comment.