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