simplify vote switch

This commit is contained in:
caneleex 2022-01-17 09:05:33 +01:00
parent 27c6fa88ab
commit b48a2096e7

View File

@ -229,12 +229,11 @@ public abstract class SponsorBlockUtils {
new AlertDialog.Builder(context)
.setItems(items, (dialog1, which1) -> {
appContext = new WeakReference<>(context.getApplicationContext());
switch (voteOptions[which1]) {
VoteOption voteOption = voteOptions[which1];
switch (voteOption) {
case UPVOTE:
voteForSegment(segment, VoteOption.UPVOTE, appContext.get(), toastRunnable);
break;
case DOWNVOTE:
voteForSegment(segment, VoteOption.DOWNVOTE, appContext.get(), toastRunnable);
voteForSegment(segment, voteOption, appContext.get(), toastRunnable);
break;
case CATEGORY_CHANGE:
onNewCategorySelect(segment, context);