From eea52cf1c9094c80235381b1b4c1041ea29181b1 Mon Sep 17 00:00:00 2001 From: mac Date: Mon, 1 Jul 2024 00:59:01 +0300 Subject: [PATCH] Close modal if there's no palette left --- components/LoadModal.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/LoadModal.jsx b/components/LoadModal.jsx index ca1045c..bd66aee 100644 --- a/components/LoadModal.jsx +++ b/components/LoadModal.jsx @@ -44,6 +44,10 @@ export default ({ modalIsOpen, closeModal }) => { maxAge: 315360000 }) setState({ palettes: newPalettes }) + + if (!newPalettes.length) { + closeModal() + } } return (