From c76cc20a7d770a0bd303f459541aa4dd51228978 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 24 Jan 2024 13:00:43 +0200 Subject: [PATCH] Fix default value for new fields --- public/scripts/world-info.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index 6e28b08ae..a6a551792 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -1540,7 +1540,7 @@ function getWorldEntry(name, data, entry) { setOriginalDataValue(data, uid, 'extensions.case_sensitive', data.entries[uid].caseSensitive); saveWorldInfo(name, data); }); - caseSensitiveSelect.val(entry.caseSensitive === null ? 'null' : entry.caseSensitive ? 'true' : 'false').trigger('input'); + caseSensitiveSelect.val((entry.caseSensitive === null || entry.caseSensitive === undefined) ? 'null' : entry.caseSensitive ? 'true' : 'false').trigger('input'); // match whole words select const matchWholeWordsSelect = template.find('select[name="matchWholeWords"]'); @@ -1553,7 +1553,7 @@ function getWorldEntry(name, data, entry) { setOriginalDataValue(data, uid, 'extensions.match_whole_words', data.entries[uid].matchWholeWords); saveWorldInfo(name, data); }); - matchWholeWordsSelect.val(entry.matchWholeWords === null ? 'null' : entry.matchWholeWords ? 'true' : 'false').trigger('input'); + matchWholeWordsSelect.val((entry.matchWholeWords === null || entry.matchWholeWords === undefined) ? 'null' : entry.matchWholeWords ? 'true' : 'false').trigger('input'); template.find('.inline-drawer-content').css('display', 'none'); //entries start collapsed