about summary refs log tree commit diff
path: root/src/view/com/lightbox/Lightbox.web.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-05-17 12:30:54 -0500
committerPaul Frazee <pfrazee@gmail.com>2023-05-17 12:30:54 -0500
commit7aa1d9010e26da14a843efab0389386144cc978a (patch)
tree31ac7916fd7e1045bce0a078d67cc1164cc2e42f /src/view/com/lightbox/Lightbox.web.tsx
parent52c72d65326c2df6ada7547103c18ed41b51ebda (diff)
parent0ca096138a690f036828c49f9e95cf394b1a4339 (diff)
downloadvoidsky-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.tsx5
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