mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2025-02-10 11:04:46 +00:00
![Alec Armbruster](/assets/img/avatar_default.png)
* wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Update src/shared/utils/app/convert-comment-sort-type.ts Co-authored-by: SleeplessOne1917 <abias1122@gmail.com> * prettier pass --------- Co-authored-by: SleeplessOne1917 <abias1122@gmail.com>
9 lines
245 B
TypeScript
9 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;
|
|
}
|
|
}
|