diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-05-17 12:30:54 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2023-05-17 12:30:54 -0500 |
commit | 7aa1d9010e26da14a843efab0389386144cc978a (patch) | |
tree | 31ac7916fd7e1045bce0a078d67cc1164cc2e42f /src/view/com/lightbox/Lightbox.web.tsx | |
parent | 52c72d65326c2df6ada7547103c18ed41b51ebda (diff) | |
parent | 0ca096138a690f036828c49f9e95cf394b1a4339 (diff) | |
download | voidsky-7aa1d9010e26da14a843efab0389386144cc978a.tar.zst |
Merge branch 'main' into custom-algos
Diffstat (limited to 'src/view/com/lightbox/Lightbox.web.tsx')
-rw-r--r-- | src/view/com/lightbox/Lightbox.web.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/view/com/lightbox/Lightbox.web.tsx b/src/view/com/lightbox/Lightbox.web.tsx index eff9af2d2..d389279b1 100644 --- a/src/view/com/lightbox/Lightbox.web.tsx +++ b/src/view/com/lightbox/Lightbox.web.tsx @@ -21,6 +21,9 @@ interface Img { export const Lightbox = observer(function Lightbox() { const store = useStores() + + const onClose = useCallback(() => store.shell.closeLightbox(), [store.shell]) + if (!store.shell.isLightboxActive) { return null } @@ -29,8 +32,6 @@ export const Lightbox = observer(function Lightbox() { const initialIndex = activeLightbox instanceof models.ImagesLightbox ? activeLightbox.index : 0 - const onClose = () => store.shell.closeLightbox() - let imgs: Img[] | undefined if (activeLightbox instanceof models.ProfileImageLightbox) { const opts = activeLightbox |