fix: idle timer restart on save
This commit is contained in:
@@ -330,6 +330,7 @@ export default function PreviewScreen({
|
||||
setTimeout(() => {
|
||||
if (!mountedRef.current) return;
|
||||
setIsProcessing(false);
|
||||
resetIdleTimer();
|
||||
}, 1500);
|
||||
} catch (error: any) {
|
||||
if (!mountedRef.current) return;
|
||||
@@ -341,9 +342,16 @@ export default function PreviewScreen({
|
||||
|
||||
const handleExitRef = useRef<(() => void) | null>(null);
|
||||
handleExitRef.current = async () => {
|
||||
logger.log('Idle timer triggered or BEENDEN clicked. Exiting PreviewScreen...');
|
||||
if (idleTimerRef.current) clearTimeout(idleTimerRef.current);
|
||||
if (!mountedRef.current) return;
|
||||
if (isProcessing) return;
|
||||
if (!mountedRef.current) {
|
||||
logger.log('PreviewScreen already unmounted, aborting exit.');
|
||||
return;
|
||||
}
|
||||
if (isProcessing) {
|
||||
logger.log('Currently processing, aborting auto-exit.');
|
||||
return;
|
||||
}
|
||||
const state = stateRef.current;
|
||||
if (state.stickers.length === 0 && state.layout === 'single' && !state.activeFrame && state.dateOverlay === 'off') {
|
||||
state.onReset();
|
||||
|
||||
Reference in New Issue
Block a user