MCPcopy Create free account
hub / github.com/cutedCha/noteBoook / handleContinueReading

Function handleContinueReading

js/app.js:1132–1166  ·  view source on GitHub ↗

* 处理"继续阅读"按钮点击 * 跳转到上次阅读的位置 * Requirements: 7.3

()

Source from the content-addressed store, hash-verified

1130 * Requirements: 7.3
1131 */
1132function handleContinueReading() {
1133 // 隐藏弹窗
1134 hideContinueReadingModal();
1135
1136 // 获取保存的阅读进度
1137 if (typeof StorageManager === 'undefined') {
1138 return;
1139 }
1140
1141 const progress = StorageManager.getProgress();
1142 if (!progress || !progress.chapter) {
1143 // 如果没有进度,显示目录
1144 showTableOfContents();
1145 return;
1146 }
1147
1148 // 跳转到保存的章节
1149 if (typeof NavigationSystem !== 'undefined' && NavigationSystem.goToChapter) {
1150 NavigationSystem.goToChapter(progress.chapter);
1151
1152 // 如果有保存的页码,跳转到对应页
1153 if (progress.page && progress.page > 1) {
1154 // 延迟执行,等待章节内容加载完成
1155 setTimeout(() => {
1156 if (typeof PageRenderer !== 'undefined' && PageRenderer.goToPage) {
1157 const contentContainer = document.querySelector('.page-content');
1158 PageRenderer.goToPage(progress.page, contentContainer);
1159 }
1160 }, 100);
1161 }
1162 } else {
1163 // 备用方案:显示目录
1164 showTableOfContents();
1165 }
1166}
1167
1168/**
1169 * 处理"从头开始"按钮点击

Callers

nothing calls this directly

Calls 2

hideContinueReadingModalFunction · 0.85
showTableOfContentsFunction · 0.85

Tested by

no test coverage detected