* 检查是否有保存的阅读进度,并显示继续阅读提示 * Requirements: 7.2, 7.3
()
| 1039 | * Requirements: 7.2, 7.3 |
| 1040 | */ |
| 1041 | function 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 | * 获取章节信息 |
no test coverage detected