···194194195195// Enter deep sleep mode
196196void enterDeepSleep() {
197197+ APP_STATE.lastSleepFromReader = currentActivity && currentActivity->isReaderActivity();
198198+ APP_STATE.saveToFile();
197199 exitActivity();
198200 enterNewActivity(new SleepActivity(renderer, mappedInputManager));
199201···331333 APP_STATE.loadFromFile();
332334 RECENT_BOOKS.loadFromFile();
333335334334- // Boot to home screen directly when back button is held or when reader activity crashes 3 times
335335- if (APP_STATE.openEpubPath.empty() || mappedInputManager.isPressed(MappedInputManager::Button::Back) ||
336336- APP_STATE.readerActivityLoadCount > 0) {
336336+ // Boot to home screen if no book is open, last sleep was not from reader, back button is held, or reader activity
337337+ // crashed (indicated by readerActivityLoadCount > 0)
338338+ if (APP_STATE.openEpubPath.empty() || !APP_STATE.lastSleepFromReader ||
339339+ mappedInputManager.isPressed(MappedInputManager::Button::Back) || APP_STATE.readerActivityLoadCount > 0) {
337340 onGoHome();
338341 } else {
339342 // Clear app state to avoid getting into a boot loop if the epub doesn't load