Added fallback if colormode file doesn't exi--

This commit is contained in:
midn8hustlr
2024-03-17 14:35:23 +05:30
parent c5d6fa15a8
commit 6f0ca3acaa
2 changed files with 15 additions and 7 deletions
@@ -65,7 +65,9 @@ const ColorSchemeSettingsRevealer = () => {
});
}
function calculateSchemeInitIndex(optionsArr, searchValue = 'monochrome') {
function calculateSchemeInitIndex(optionsArr, searchValue = 'tonalspot') {
if (searchValue == '')
searchValue = 'tonalspot';
const flatArray = optionsArr.flatMap(subArray => subArray);
const result = flatArray.findIndex(element => element.value === searchValue);
const rowIndex = Math.floor(result / optionsArr[0].length);