mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2025-02-10 19:14:52 +00:00
10 lines
245 B
TypeScript
10 lines
245 B
TypeScript
![]() |
import { VoteType } from "../../interfaces";
|
||
|
|
||
|
export default function newVote(voteType: VoteType, myVote?: number): number {
|
||
|
if (voteType == VoteType.Upvote) {
|
||
|
return myVote == 1 ? 0 : 1;
|
||
|
} else {
|
||
|
return myVote == -1 ? 0 : -1;
|
||
|
}
|
||
|
}
|