generated from Seekra/repository-template
fix(settings): fix handling of non-existent paths
Previously, the settings view now does not check whether the settings content is falsy. But, if the setting does not exist, the setting itself is undefined. So, if the specified settings path did not exist, an error was thrown. Now, the setting is checked for being falsy, not the setting content.
This commit is contained in:
@@ -44,7 +44,7 @@ watchEffect(() => {
|
|||||||
const updateSettings = function updateSettings () {
|
const updateSettings = function updateSettings () {
|
||||||
if (activeSection.value) {
|
if (activeSection.value) {
|
||||||
const setting = getSettingRecursively(activeSection.value, settings.value);
|
const setting = getSettingRecursively(activeSection.value, settings.value);
|
||||||
if (!setting.content) {
|
if (!setting) {
|
||||||
router.push('/settings');
|
router.push('/settings');
|
||||||
} else {
|
} else {
|
||||||
activeSectionContent.value = setting;
|
activeSectionContent.value = setting;
|
||||||
|
|||||||
Reference in New Issue
Block a user