Skip to content

Commit

Permalink
fix: uepr-38: debug modal description and image preload
Browse files Browse the repository at this point in the history
  • Loading branch information
KManolov3 committed Nov 19, 2024
1 parent f561493 commit 703907f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/components/debug-modal/debug-modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/components/debug-modal/sections/sections.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const sections = [
description: <div>
<p><FormattedMessage {...messages.checkTheValuesDescription1} /></p>
<ul>
<li><FormattedMessage {...messages.checkCodeSequenceDescription2} /></li>
<li><FormattedMessage {...messages.checkTheValuesDescription2} /></li>
<li><FormattedMessage {...messages.checkTheValuesDescription3} /></li>
</ul>
</div>,
Expand Down

0 comments on commit 703907f

Please sign in to comment.