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

Function checkAndShowContinueReading

js/app.js:1041–1070  ·  view source on GitHub ↗

* 检查是否有保存的阅读进度,并显示继续阅读提示 * Requirements: 7.2, 7.3

()

Source from the content-addressed store, hash-verified

1039 * Requirements: 7.2, 7.3
1040 */
1041function checkAndShowContinueReading() {
1042 // 检查 StorageManager 是否可用
1043 if (typeof StorageManager === 'undefined') {
1044 console.warn('StorageManager 未定义,无法检查阅读进度');
1045 return;
1046 }
1047
1048 // 检查是否有保存的阅读进度
1049 if (!StorageManager.hasProgress()) {
1050 return;
1051 }
1052
1053 // 获取阅读进度
1054 const progress = StorageManager.getProgress();
1055 if (!progress || !progress.chapter) {
1056 return;
1057 }
1058
1059 // 获取章节信息
1060 const chapter = getChapterInfo(progress.chapter);
1061 if (!chapter) {
1062 return;
1063 }
1064
1065 // 更新弹窗中的章节信息
1066 updateContinueReadingModal(chapter, progress.page);
1067
1068 // 显示继续阅读弹窗
1069 showContinueReadingModal();
1070}
1071
1072/**
1073 * 获取章节信息

Callers 1

initAppFunction · 0.85

Calls 3

getChapterInfoFunction · 0.85
showContinueReadingModalFunction · 0.85

Tested by

no test coverage detected