Skip to content

Commit 9df9b05

Browse files
committed
Fix custom themes not loading correctly
1 parent a28ace5 commit 9df9b05

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Source/Utility/SettingsFile.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,17 +562,20 @@ void SettingsFile::loadThemeFromDiff(Array<var>& savedThemes)
562562
if (!savedThemeObj) continue;
563563

564564
auto const themeName = savedThemeObj->getProperty("name").toString();
565-
565+
bool isDefaultTheme = false;
566566
for (auto& current : currentThemes)
567567
{
568568
auto* currentThemeObj = current.getDynamicObject();
569569
if (!currentThemeObj || currentThemeObj->getProperty("name").toString() != themeName) continue;
570570

571+
isDefaultTheme = true;
571572
for (auto const& [propName, propValue] : savedThemeObj->getProperties())
572573
if (propName != Identifier("name"))
573574
currentThemeObj->setProperty(propName, propValue);
574575
break;
575576
}
577+
if(!isDefaultTheme)
578+
currentThemes.add(savedTheme);
576579
}
577580
}
578581

0 commit comments

Comments
 (0)