Skip to content

Commit

Permalink
Merge pull request #2107 from proddy/dev
Browse files Browse the repository at this point in the history
dont show broken link if IMG cant be found
  • Loading branch information
proddy authored Oct 17, 2024
2 parents 210637f + 8496109 commit 8bab757
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion interface/src/app/main/Help.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const Help = () => {

const [customSupportIMG, setCustomSupportIMG] = useState<string | null>(null);
const [customSupportHTML, setCustomSupportHTML] = useState<string | null>(null);
const [notFound, setNotFound] = useState<boolean>(false);

useRequest(() => callAction({ action: 'customSupport' })).onSuccess((event) => {
if (event && event.data && Object.keys(event.data).length !== 0) {
Expand Down Expand Up @@ -102,7 +103,12 @@ const Help = () => {
sx={{
maxHeight: { xs: 100, md: 250 }
}}
src={customSupportIMG || 'https://emsesp.org/_media/images/installer.jpeg'}
onError={(e) => setNotFound(true)}
src={
notFound
? ''
: customSupportIMG || 'https://emsesp.org/_media/images/installer.jpeg'
}
/>
</Stack>

Expand Down
4 changes: 2 additions & 2 deletions src/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,9 @@ void System::system_check() {
#ifndef EMSESP_STANDALONE
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S2
#if ESP_IDF_VERSION_MAJOR < 5
temp_sensor_read_celsius(&temperature_);
temp_sensor_read_celsius(&temperature_);
#else
temperature_sensor_get_celsius(temperature_handle_, &temperature_);
temperature_sensor_get_celsius(temperature_handle_, &temperature_);
#endif
#endif
#endif
Expand Down

0 comments on commit 8bab757

Please sign in to comment.