fix: Simpler goBack

This commit is contained in:
Marc Rousavy 2022-01-10 17:13:20 +01:00
parent 137f5272e3
commit 17b33de4d7

View File

@ -39,10 +39,6 @@ export function MediaPage({ navigation, route }: Props): React.ReactElement {
const isVideoPaused = !isForeground || !isScreenFocused;
const [savingState, setSavingState] = useState<'none' | 'saving' | 'saved'>('none');
const onClosePressed = useCallback(() => {
navigation.goBack();
}, [navigation]);
const onMediaLoad = useCallback((event: OnLoadData | NativeSyntheticEvent<ImageLoadEventData>) => {
if (isVideoOnLoadEvent(event)) {
console.log(
@ -110,7 +106,7 @@ export function MediaPage({ navigation, route }: Props): React.ReactElement {
/>
)}
<PressableOpacity style={styles.closeButton} onPress={onClosePressed}>
<PressableOpacity style={styles.closeButton} onPress={navigation.goBack}>
<IonIcon name="close" size={35} color="white" style={styles.icon} />
</PressableOpacity>