diff --git a/src/General/lib/databoard.class b/src/General/lib/databoard.class index 236d00b8f..905d080d4 100755 --- a/src/General/lib/databoard.class +++ b/src/General/lib/databoard.class @@ -49,7 +49,6 @@ class DataBoard @save() get: ({boardID, threadID, postID, defaultValue}) -> - $.forceSync @key if board = @data.boards[boardID] unless threadID if postID @@ -66,6 +65,9 @@ class DataBoard thread val or defaultValue + forceSync: -> + $.forceSync @key + clean: -> $.forceSync @key for boardID, val of @data.boards diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index f97493814..f904b0629 100755 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -97,6 +97,7 @@ ThreadWatcher = onIndexRefresh: -> {db} = ThreadWatcher boardID = g.BOARD.ID + db.forceSync() for threadID, data of db.data.boards[boardID] when not data.isDead and threadID not of g.BOARD.threads if Conf['Auto Prune'] ThreadWatcher.db.delete {boardID, threadID} @@ -114,6 +115,7 @@ ThreadWatcher = fetched: 0 fetching: 0 fetchAllStatus: -> + ThreadWatcher.db.forceSync() return unless (threads = ThreadWatcher.getAll()).length for thread in threads ThreadWatcher.fetchStatus thread diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index 1c0ccdbcf..8ec4646dd 100755 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -20,6 +20,7 @@ Unread = node: -> Unread.thread = @ Unread.title = d.title + Unread.db.forceSync() Unread.lastReadPost = Unread.db.get boardID: @board.ID threadID: @ID @@ -57,6 +58,7 @@ Unread = Header.scrollTo root, down if Header.getBottomOf(root) < 0 sync: -> + return unless Unread.lastReadPost? lastReadPost = Unread.db.get boardID: Unread.thread.board.ID threadID: Unread.thread.ID