feat: replace raw setInterval polling with shared Poller utility across six frontend modules

This commit is contained in:
2026-06-09 16:37:49 +00:00
parent 1ec011ecb2
commit 66dfda88bc
27 changed files with 282 additions and 350 deletions
+4 -8
View File
@@ -1,7 +1,8 @@
import { Http } from "./Http.js";
import { OptimisticAction } from "./OptimisticAction.js";
export class ReactionBar {
export class ReactionBar extends OptimisticAction {
constructor() {
super();
document.addEventListener("click", (event) => this.onClick(event));
}
@@ -42,12 +43,7 @@ export class ReactionBar {
const type = bar.dataset.reactionType;
const uid = bar.dataset.reactionUid;
const emoji = trigger.dataset.reactionEmoji;
try {
const result = await Http.sendForm(`/reactions/${type}/${uid}`, { emoji });
this.render(bar, result);
} catch (error) {
console.error("reaction failed", error);
}
await this.submit(`/reactions/${type}/${uid}`, { emoji }, null, (result) => this.render(bar, result));
this.closeAllPalettes();
}