Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ export default class PostUpdater extends StreamUpdater {

constructor(postStream, postId) {
super();

this.postStream = postStream;
this.postId = postId;
this.post = postStream.findLoadedPost(postId);
const topicId = postStream.topic.id;

if (this.post) {
if (this.post && topicId) {
this.postElement = document.querySelector(
`#post_${this.post.post_number}`
`.topic-area[data-topic-id="${topicId}"] #post_${this.post.post_number}`
);
}
}
Expand Down Expand Up @@ -57,6 +59,10 @@ export default class PostUpdater extends StreamUpdater {
}

async setCooked(value) {
if (!this.postElement) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not attempt to find cooked on a non existing element

return;
}

this.post.set("cooked", value);

(await loadMorphlex()).morphInner(
Expand Down
Loading