Skip to content

Commit ff4bd32

Browse files
committed
Enhance getImage method to use user-uploaded custom images in priority
1 parent 37c459a commit ff4bd32

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

core/class/zwavejs.class.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2265,9 +2265,15 @@ public function getImgFilePath() {
22652265
}
22662266

22672267
public function getImage() {
2268+
$default = parent::getImage();
2269+
$plugin = plugin::byId(__CLASS__);
2270+
if ($default != $plugin->getPathImgIcon()) {
2271+
return $default; // this is a custom image uploaded by the user, we keep it
2272+
}
2273+
22682274
$file = 'plugins/zwavejs/core/config/devices/' . $this->getImgFilePath();
22692275
if (!is_file(__DIR__ . '/../../../../' . $file)) {
2270-
return parent::getImage();
2276+
return $default;
22712277
}
22722278
return $file;
22732279
}

0 commit comments

Comments
 (0)