bugfix catalog adding to wl

jschan
Thomas Lynch 3 years ago
parent ccfbe91b6c
commit 833cb6ffa1
No known key found for this signature in database
GPG Key ID: 36A72F7C62CF8480
  1. 6
      gulp/res/js/filters.js
  2. 2
      gulp/res/js/watchlist.js

@ -263,10 +263,8 @@ const postMenuChange = function(e) {
case 'moderate':
return moderatePost(postContainer);
case 'watch':
if (postContainer.classList.contains('op')) {
const watcherSubject = (postDataset.subject || postContainer.querySelector('.post-message').textContent || "No subject").substring(0, 25);
threadWatcher.add(postDataset.board, postDataset.postId, { subject: watcherSubject, unread: 0, updatedDate: new Date() });
}
const watcherSubject = (postDataset.subject || postContainer.querySelector('.post-message').textContent || "No subject").substring(0, 25);
threadWatcher.add(postDataset.board, postDataset.postId, { subject: watcherSubject, unread: 0, updatedDate: new Date() });
return;
}
toggleFilter(filterType, filterData, hiding);

@ -207,6 +207,7 @@ class ThreadWatcher {
//add a thread to the watchlist map
add(board, postId, data) {
console.log(board, postId, data)
const key = `${board}-${postId}`;
if (this.watchListMap.has(key)) {
//dont add duplicates
@ -239,7 +240,6 @@ class ThreadWatcher {
addRow(board, postId, data) {
const isCurrentThread = this.threadMatch != null
&& this.threadMatch[1] === board && this.threadMatch[2] === postId;
console.log(this.threadMatch, isCurrentThread)
const watchListItemHtml = watchedthread({ watchedthread: { board, postId, ...data, isCurrentThread } });
this.threadWatcher.insertAdjacentHTML('beforeend', watchListItemHtml);
const watchedThreadElem = this.threadWatcher.lastChild;

Loading…
Cancel
Save