diff --git a/src/components/homeScreenSettings/homeScreenSettings.js b/src/components/homeScreenSettings/homeScreenSettings.js index 338a484dfdd..ead15788c5a 100644 --- a/src/components/homeScreenSettings/homeScreenSettings.js +++ b/src/components/homeScreenSettings/homeScreenSettings.js @@ -20,7 +20,7 @@ import toast from '../toast/toast'; import template from './homeScreenSettings.template.html'; import { LibraryTab } from '../../types/libraryTab.ts'; -const numConfigurableSections = 7; +const numConfigurableSections = 10; function renderViews(page, user, result) { let folderHtml = ''; @@ -204,15 +204,15 @@ function renderViewOrder(context, user, result) { } function updateHomeSectionValues(context, userSettings) { - for (let i = 1; i <= 7; i++) { + for (let i = 1; i <= numConfigurableSections; i++) { const select = context.querySelector(`#selectHomeSection${i}`); const defaultValue = homeSections.getDefaultSection(i - 1); - const option = select.querySelector(`option[value=${defaultValue}]`) || select.querySelector('option[value=""]'); + const option = select.querySelector(`option[value="${defaultValue}"]`) || select.querySelector('option[value=""]'); const userValue = userSettings.get(`homesection${i - 1}`); - option.value = ''; + if (option) option.value = ''; if (userValue === defaultValue || !userValue) { select.value = ''; @@ -390,6 +390,9 @@ function saveUser(context, user, userSettingsInstance, apiClient) { userSettingsInstance.set('homesection4', context.querySelector('#selectHomeSection5').value); userSettingsInstance.set('homesection5', context.querySelector('#selectHomeSection6').value); userSettingsInstance.set('homesection6', context.querySelector('#selectHomeSection7').value); + userSettingsInstance.set('homesection7', context.querySelector('#selectHomeSection8').value); + userSettingsInstance.set('homesection8', context.querySelector('#selectHomeSection9').value); + userSettingsInstance.set('homesection9', context.querySelector('#selectHomeSection10').value); const selectLandings = context.querySelectorAll('.selectLanding'); for (i = 0, length = selectLandings.length; i < length; i++) { diff --git a/src/components/homeScreenSettings/homeScreenSettings.template.html b/src/components/homeScreenSettings/homeScreenSettings.template.html index d3a9206c331..a46e7327f23 100644 --- a/src/components/homeScreenSettings/homeScreenSettings.template.html +++ b/src/components/homeScreenSettings/homeScreenSettings.template.html @@ -115,6 +115,48 @@