From bc106903040ff750e8ab51ba93b04ca3ef55f64d Mon Sep 17 00:00:00 2001 From: Nanobyte Date: Sun, 20 Dec 2020 22:48:38 +0100 Subject: [PATCH] Ensure correct start- endtime order #585 --- src/content.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/content.ts b/src/content.ts index 5371016a..a77730c2 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1181,6 +1181,7 @@ function startSponsorClicked() { if (sponsorTimesSubmitting.length > 0 && sponsorTimesSubmitting[sponsorTimesSubmitting.length - 1].segment.length < 2) { //it is an end time sponsorTimesSubmitting[sponsorTimesSubmitting.length - 1].segment[1] = getRealCurrentTime(); + sponsorTimesSubmitting[sponsorTimesSubmitting.length - 1].segment.sort((a, b) => a > b ? 1 : (a < b ? -1 : 0)); } else { //it is a start time sponsorTimesSubmitting.push({