From 610c7ebaee31fda26c50ff69f1ea7fd6f142d717 Mon Sep 17 00:00:00 2001 From: Michael Ochmann Date: Sun, 2 Oct 2022 15:05:01 +0200 Subject: [PATCH] . --- src/ui/src/components/Ation.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ui/src/components/Ation.js b/src/ui/src/components/Ation.js index 121852d..c9ee4fd 100644 --- a/src/ui/src/components/Ation.js +++ b/src/ui/src/components/Ation.js @@ -20,14 +20,15 @@ const Ation = () => { useEffect(() => { window.api.onFileOpen(presentation => { - const [basePath, slideDeck] = presentation; + const [newBasePath, slideDeck] = presentation; if (!slideDeck) return; - setBasePath(basePath); + if (newBasePath !== basePath) + setSlide(0); + setBasePath(newBasePath); setDeck(slideDeck); - setSlide(0); }); - }, []); + }, [basePath]); const openFile = () => { window.api.openFileDialog();