Fix 5 hidden edge cases: IPP decode, settings race, PreviewScreen state sync, burst timeout leak, and logger spam

This commit is contained in:
2026-05-31 23:47:25 +02:00
parent ecfc6e5d31
commit d38115528e
5 changed files with 38 additions and 23 deletions
+21 -2
View File
@@ -96,6 +96,7 @@ export default function CameraScreen({
const expoCameraRef = useRef<any>(null);
const burstTimerRef = useRef<any>(null);
const countdownTimerRef = useRef<any>(null);
const completionTimerRef = useRef<any>(null);
const isCancelledRef = useRef<boolean>(false);
// Reanimated countdown pulse animation
@@ -162,6 +163,7 @@ export default function CameraScreen({
return () => {
if (burstTimerRef.current) clearTimeout(burstTimerRef.current);
if (countdownTimerRef.current) clearTimeout(countdownTimerRef.current);
if (completionTimerRef.current) clearTimeout(completionTimerRef.current);
};
}, []);
@@ -207,6 +209,7 @@ export default function CameraScreen({
isCancelledRef.current = true;
if (burstTimerRef.current) clearTimeout(burstTimerRef.current);
if (countdownTimerRef.current) clearTimeout(countdownTimerRef.current);
if (completionTimerRef.current) clearTimeout(completionTimerRef.current);
// Clean up any temp files from a partially completed burst
for (const uri of burstUris) {
@@ -362,12 +365,12 @@ export default function CameraScreen({
setBurstIndex(0);
setBurstUris([]);
// Short delay prevents Android expo-camera crash on immediate unmount
setTimeout(() => {
completionTimerRef.current = setTimeout(() => {
onBurstComplete(newUris);
}, 400);
} else {
// Single shot mode
setTimeout(() => {
completionTimerRef.current = setTimeout(() => {
onPhotoCaptured(capturedUri);
}, 400);
}
@@ -443,6 +446,22 @@ export default function CameraScreen({
>
{welcomeText}
</Text>
{/* White Outline Layers */}
{[
{ t: -2, l: -2 }, { t: -2, l: 0 }, { t: -2, l: 2 },
{ t: 0, l: -2 }, { t: 0, l: 2 },
{ t: 2, l: -2 }, { t: 2, l: 0 }, { t: 2, l: 2 }
].map((pos, index) => (
<Text
key={`outline-${index}`}
style={[styles.headerTitleBase, { position: 'absolute', color: 'white', top: pos.t, left: pos.l }]}
adjustsFontSizeToFit
numberOfLines={1}
>
{welcomeText}
</Text>
))}
{/* Gradient Text Layer over the shadow layer */}
<MaskedView