mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-12-01 00:02:55 +01:00
Merge pull request #26 from caneleex/patch/voting-nosegments
add toast when voting while no segments are present
This commit is contained in:
commit
7c5102ab87
@ -374,8 +374,10 @@ public abstract class SponsorBlockUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void onVotingClicked(final Context context) {
|
public static void onVotingClicked(final Context context) {
|
||||||
if (sponsorSegmentsOfCurrentVideo == null || sponsorSegmentsOfCurrentVideo.length == 0) // prevent crashing or empty dialog
|
if (sponsorSegmentsOfCurrentVideo == null || sponsorSegmentsOfCurrentVideo.length == 0) {
|
||||||
|
Toast.makeText(context.getApplicationContext(), str("vote_no_segments"), Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
CharSequence[] titles = new CharSequence[sponsorSegmentsOfCurrentVideo.length];
|
CharSequence[] titles = new CharSequence[sponsorSegmentsOfCurrentVideo.length];
|
||||||
for (int i = 0; i < sponsorSegmentsOfCurrentVideo.length; i++) {
|
for (int i = 0; i < sponsorSegmentsOfCurrentVideo.length; i++) {
|
||||||
SponsorSegment segment = sponsorSegmentsOfCurrentVideo[i];
|
SponsorSegment segment = sponsorSegmentsOfCurrentVideo[i];
|
||||||
|
@ -198,6 +198,7 @@
|
|||||||
<string name="vote_upvote">Upvote</string>
|
<string name="vote_upvote">Upvote</string>
|
||||||
<string name="vote_downvote">Downvote</string>
|
<string name="vote_downvote">Downvote</string>
|
||||||
<string name="vote_category">Change category</string>
|
<string name="vote_category">Change category</string>
|
||||||
|
<string name="vote_no_segments">There are no segments to vote for</string>
|
||||||
|
|
||||||
<string name="new_segment_choose_category">Choose the segment category</string>
|
<string name="new_segment_choose_category">Choose the segment category</string>
|
||||||
<string name="new_segment_disabled_category">You\'ve disabled this category in the settings, enable it to be able to submit</string>
|
<string name="new_segment_disabled_category">You\'ve disabled this category in the settings, enable it to be able to submit</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user