diff --git a/NGA_BBS_plugins/MobileSupport/MobileSupport.user.js b/NGA_BBS_plugins/MobileSupport/MobileSupport.user.js index 6c69abb..544a021 100644 --- a/NGA_BBS_plugins/MobileSupport/MobileSupport.user.js +++ b/NGA_BBS_plugins/MobileSupport/MobileSupport.user.js @@ -37,6 +37,7 @@ this.pluginSettings['showPostReadingRecord'] = false; } }, + currentThread: {}, async renderThreadsFunc($el) { if (this.pluginSettings['showPostReadingRecord']) { const postReadingRecord = this.mainScript.getModule('PostReadingRecord'); @@ -53,7 +54,7 @@ if (postReadingRecord.pluginSettings['replyCountEnable'] && recordCount > -1 && currentCount > recordCount) { $el.find('.c2 > span[id^=t_pc]').append(`${currentCount-recordCount}`) } - postReadingRecord.currentThread[tid] = {currentCount} + this.currentThread[tid] = {currentCount} } } }, @@ -62,9 +63,9 @@ const postReadingRecord = this.mainScript.getModule('PostReadingRecord'); if (postReadingRecord) { const tid = this.mainScript.getModule('AuthorMark').getQueryString('tid'); - const currentLineNo = parseInt($el.find('.postinfot').text().split('#')[1]); - const currentLineAnchor = $el.find('.postinfot').attr('href').split('#')[1] - const maxReadCount = Math.max((postReadingRecord.currentThread?.[tid]?.currentCount || -1), currentLineNo) + const currentLineNo = parseInt($el.find('.postinfot.postoptswb').text().split('#')[1]); + const currentLineAnchor = $el.find('.postinfot.postoptswb').attr('href').split('#')[1] + const maxReadCount = Math.max((this.currentThread?.[tid]?.currentCount || -1), currentLineNo) const record = await postReadingRecord.store.getItem(tid) if (!record || maxReadCount > record.lastReadCount) { await postReadingRecord.store.setItem(tid, {