Fix cancel logic and disable New Architecture to prevent ViewShot crash
This commit is contained in:
@@ -158,6 +158,18 @@ export default function CameraScreen({
|
||||
};
|
||||
}, []);
|
||||
|
||||
// Cancel capture process
|
||||
const handleLocalCancel = () => {
|
||||
if (countdownTimerRef.current) clearInterval(countdownTimerRef.current);
|
||||
if (burstTimerRef.current) clearTimeout(burstTimerRef.current);
|
||||
setCountdown(countdownDuration);
|
||||
setIsCapturing(false);
|
||||
setBurstIndex(0);
|
||||
setBurstUris([]);
|
||||
setShowBurstIndicator('');
|
||||
onCancel();
|
||||
};
|
||||
|
||||
// 3. Start the countdown on screen load (only when NOT idle)
|
||||
useEffect(() => {
|
||||
if (isIdle) {
|
||||
@@ -353,15 +365,6 @@ export default function CameraScreen({
|
||||
}
|
||||
};
|
||||
|
||||
const handleCancel = useCallback(() => {
|
||||
if (burstTimerRef.current) {
|
||||
clearTimeout(burstTimerRef.current);
|
||||
}
|
||||
setHasStarted(false);
|
||||
setIsCapturing(false);
|
||||
onCancel();
|
||||
}, [onCancel]);
|
||||
|
||||
const handleSettingsTap = () => {
|
||||
setEnteredPassword('');
|
||||
setErrorText('');
|
||||
@@ -395,7 +398,7 @@ export default function CameraScreen({
|
||||
<TouchableOpacity style={styles.btn} onPress={requestPermission}>
|
||||
<Text style={styles.btnText}>Erlaubnis erteilen</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity style={[styles.btn, styles.cancelBtn]} onPress={onCancel}>
|
||||
<TouchableOpacity style={[styles.btn, styles.cancelBtn]} onPress={handleLocalCancel}>
|
||||
<Text style={styles.btnText}>Zurück</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
@@ -538,7 +541,7 @@ export default function CameraScreen({
|
||||
|
||||
{/* Cancel Button */}
|
||||
{!isCapturing && !isBurstWaiting && (
|
||||
<TouchableOpacity style={styles.backButton} onPress={handleCancel}>
|
||||
<TouchableOpacity style={styles.backButton} onPress={handleLocalCancel}>
|
||||
<FontAwesomeIcon icon={faXmark} size={16} color={THEME.colors.text} style={{ marginRight: 6 }} />
|
||||
<Text style={styles.backButtonText}>ABBRECHEN</Text>
|
||||
</TouchableOpacity>
|
||||
|
||||
Reference in New Issue
Block a user