FEATURE: add "Votes" option to category topic list settings (#232)

This commit is contained in:
Kris 2025-02-10 16:50:41 -05:00 committed by GitHub
parent ba733585c8
commit 8d21b18ea4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 0 deletions

View File

@ -65,5 +65,19 @@ export default {
api.addSearchSuggestion("order:votes");
}
});
withPluginApi("2.1.0", (api) => {
api.registerValueTransformer(
"category-available-views",
({ value, context }) => {
if (context.customFields.enable_topic_voting) {
value.push({
name: i18n("filters.votes.title"),
value: "votes",
});
}
}
);
});
},
};