Skip to content

Commit 8c69b93

Browse files
committed
feat(copymanga): update console logic
1 parent e0eaf6c commit 8c69b93

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/monkey/copymanga-enhance/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ const renderNewPage = (info: any) => render({
1717
setTimeout(() => {
1818
let cacheContent = sessionStorage.getItem(sessionStorageKey)
1919
if (cacheContent) {
20+
console.info('Found cache')
2021
const info = {
2122
prevUrl: void 0,
2223
nextUrl: void 0,
2324
menuUrl: void 0,
2425
...JSON.parse(cacheContent),
2526
}
2627
return renderNewPage(info)
28+
} else {
29+
console.info('Non found cache')
2730
}
2831
refreshImage(() => {
2932
windowScrollTo(0)

src/monkey/copymanga-enhance/scripts/old.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ const getCurrentCount = () => $('.comicContent-list > li > img').length
55
const getTotalCount = () => Number((document.getElementsByClassName('comicCount')[0] as HTMLDivElement).innerText)
66
export const windowScrollTo = genScrollTo(window)
77

8+
let pre = -1
9+
810
export const refreshImage = (cb: Function) => {
911
const nextTime = 15
1012
let [cur, total] = [getCurrentCount(), getTotalCount()]
11-
console.log('Process:', getCurrentCount(), '/', getTotalCount())
13+
pre !== cur && console.log('Process:', getCurrentCount(), '/', getTotalCount())
1214
if (total === 0 || cur < total) {
1315
windowScrollTo(document.getElementsByClassName('comicContent')[0].clientHeight, true)
1416
cur = getCurrentCount()
17+
pre = cur
1518
setTimeout(() => {
1619
windowScrollTo(0)
1720
setTimeout(() => refreshImage(cb), nextTime)

0 commit comments

Comments
 (0)