Log a warning on an unknown input type

63b48b921189ad1d79784cd6340d25e8243eb1c4

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +4 -3Ignore whitespace
public/scripts/popup.js+4 -3
@@ -284,9 +284,7 @@ export class Popup {
284 }284 }
285285
286 this.inputControls.appendChild(label);286 this.inputControls.appendChild(label);
287 }287 } else if (input.type === 'text') {
288
289 if (input.type === 'text') {
290 const label = document.createElement('label');288 const label = document.createElement('label');
291 label.classList.add('text_label', 'justifyCenter');289 label.classList.add('text_label', 'justifyCenter');
292 label.setAttribute('for', input.id);290 label.setAttribute('for', input.id);
@@ -306,6 +304,9 @@ export class Popup {
306 label.appendChild(inputElement);304 label.appendChild(inputElement);
307305
308 this.inputControls.appendChild(label);306 this.inputControls.appendChild(label);
307 } else {
308 console.warn('Unknown custom input type. Only checkbox and text are supported.', input);
309 return;
309 }310 }
310 });311 });
311312