Another post voting plugin test

will this js fix the need to refresh the page when a user adds a vote?

// javascripts/discourse/initializers/fix-post-voting-tracked.js
import { withPluginApi } from "discourse/lib/plugin-api";

export default {
name: "fix-post-voting-tracked",
initialize() {
withPluginApi((api) => {
// Aggiunge post_voting_vote_count come proprietà tracked
// così Glimmer re-renderizza il contatore quando cambia
api.addTrackedPostProperties("post_voting_vote_count");
});
},
};

Yes, it works like a charme

1 Answer

1

The vote counter remains stale for all users watching the topic.