From 703907f92cb5b1076b8f4bc445369c2dd7843dd8 Mon Sep 17 00:00:00 2001 From: Kaloyan Manolov Date: Tue, 19 Nov 2024 12:55:54 +0200 Subject: [PATCH] fix: uepr-38: debug modal description and image preload --- src/components/debug-modal/debug-modal.jsx | 7 +++++++ src/components/debug-modal/sections/sections.jsx | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/debug-modal/debug-modal.jsx b/src/components/debug-modal/debug-modal.jsx index 924556daac4..65edf630cb4 100644 --- a/src/components/debug-modal/debug-modal.jsx +++ b/src/components/debug-modal/debug-modal.jsx @@ -31,6 +31,13 @@ const logTopicChange = topicIndex => { const DebugModal = ({isOpen, onClose = () => {}}) => { const [selectedTopicIndex, setSelectedTopicIndex] = useState(0); + // Preload images + useEffect(() => { + sections.forEach(section => { + new Image().src = section.image; + }); + }, []); + const handleNext = useCallback(() => { if (selectedTopicIndex < sections.length - 1) { setSelectedTopicIndex(selectedTopicIndex + 1); diff --git a/src/components/debug-modal/sections/sections.jsx b/src/components/debug-modal/sections/sections.jsx index 6b1290c67d8..6295ddbabfd 100644 --- a/src/components/debug-modal/sections/sections.jsx +++ b/src/components/debug-modal/sections/sections.jsx @@ -102,7 +102,7 @@ export const sections = [ description:

,