lemmy-ui/src/shared/utils/app/vote-display-mode.ts
Dessalines d8a92812d8
Adding vote display modes (#2426)
* Adding vote display modes

* Only show downvotes setting if site has downvotes enabled.
2024-04-18 20:20:37 -04:00

15 lines
394 B
TypeScript

import { GetSiteResponse, LocalUserVoteDisplayMode } from "lemmy-js-client";
export default function voteDisplayMode(
siteRes: GetSiteResponse,
): LocalUserVoteDisplayMode {
return (
siteRes?.my_user?.local_user_view.local_user_vote_display_mode ?? {
local_user_id: -1,
upvotes: true,
downvotes: true,
score: false,
upvote_percentage: false,
}
);
}