Made it possible to set the defaultImage property for the carousel and grid elements using variables

This commit is contained in:
Leon Styhre 2023-09-08 19:34:05 +02:00
parent 3996ec6321
commit 315877b1f0

View file

@ -537,7 +537,9 @@ void SystemView::populate()
if (mCarousel != nullptr || mGrid != nullptr) {
if (element.second.has("staticImage"))
imagePath = element.second.get<std::string>("staticImage");
if (element.second.has("defaultImage"))
if (element.second.has("defaultImage") &&
Utils::FileSystem::exists(
element.second.get<std::string>("defaultImage")))
defaultImagePath = element.second.get<std::string>("defaultImage");
if (element.second.has("text"))
itemText = element.second.get<std::string>("text");