Refactor room addition logic; streamline new room creation and sorting in settings template for improved clarity and functionality

This commit is contained in:
Yaro Kasear 2025-06-20 12:49:55 -05:00
parent 3c9806bd34
commit 86a4e4d22f
2 changed files with 4 additions and 4 deletions

View file

@ -139,8 +139,10 @@
if (name.trim()) {
const newRoom = ComboBoxWidget.createOption(`${name}`, null);
document.getElementById('room-list').appendChild(newRoom);
ComboBoxWidget.sortOptions(document.getElementById('room-list'));
const selectWidget = document.getElementById('room-list');
selectWidget.appendChild(newRoom);
ComboBoxWidget.sortOptions(selectWidget);
bootstrap.Modal.getInstance(modal).hide();
} else {
alert('Please enter a room name.');