Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Close active elements on state change (#677)

authored by

Ollie H and committed by
GitHub
656baa72 09bb2f52

+14 -3
+3 -2
src/view/com/lightbox/Lightbox.web.tsx
··· 21 21 22 22 export const Lightbox = observer(function Lightbox() { 23 23 const store = useStores() 24 + 25 + const onClose = useCallback(() => store.shell.closeLightbox(), [store.shell]) 26 + 24 27 if (!store.shell.isLightboxActive) { 25 28 return null 26 29 } ··· 28 31 const activeLightbox = store.shell.activeLightbox 29 32 const initialIndex = 30 33 activeLightbox instanceof models.ImagesLightbox ? activeLightbox.index : 0 31 - 32 - const onClose = () => store.shell.closeLightbox() 33 34 34 35 let imgs: Img[] | undefined 35 36 if (activeLightbox instanceof models.ProfileImageLightbox) {
+11 -1
src/view/shell/index.web.tsx
··· 1 - import React from 'react' 1 + import React, {useEffect} from 'react' 2 2 import {observer} from 'mobx-react-lite' 3 3 import {View, StyleSheet, TouchableOpacity} from 'react-native' 4 4 import {useStores} from 'state/index' ··· 14 14 import {DrawerContent} from './Drawer' 15 15 import {useWebMediaQueries} from '../../lib/hooks/useWebMediaQueries' 16 16 import {BottomBarWeb} from './bottom-bar/BottomBarWeb' 17 + import {useNavigation} from '@react-navigation/native' 18 + import {NavigationProp} from 'lib/routes/types' 17 19 18 20 const ShellInner = observer(() => { 19 21 const store = useStores() 20 22 const {isDesktop} = useWebMediaQueries() 23 + 24 + const navigator = useNavigation<NavigationProp>() 25 + 26 + useEffect(() => { 27 + navigator.addListener('state', () => { 28 + store.shell.closeAnyActiveElement() 29 + }) 30 + }, [navigator, store.shell]) 21 31 22 32 return ( 23 33 <>