Merge pull request #347 from ajayyy/react

1.2.28 Hotfixes
This commit is contained in:
Ajay Ramachandran
2020-05-11 19:30:59 -04:00
committed by GitHub
5 changed files with 23 additions and 10 deletions

View File

@@ -72,8 +72,8 @@ jobs:
run: sudo apt-get install rename
- name: Install signed file
run: cd ./web-ext-artifacts
run: rename 's/.*/FirefoxSignedInstaller.xpi/' *
run: cd ..
- run: rename 's/.*/FirefoxSignedInstaller.xpi/' *
- run: cd ..
- uses: actions/upload-artifact@v1
with:
name: FirefoxExtensionSigned.xpi

View File

@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "__MSG_Name__",
"version": "1.2.28",
"version": "1.2.28.1",
"default_locale": "en",
"description": "__MSG_Description__",
"content_scripts": [{

View File

@@ -59,7 +59,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
componentWillUnmount() {
if (this.configUpdateListener) {
Config.configListeners.splice(Config.configListeners.indexOf(this.configUpdate.bind(this)));
Config.configListeners.splice(Config.configListeners.indexOf(this.configUpdate.bind(this)), 1);
}
}

View File

@@ -281,6 +281,16 @@ async function migrateOldFormats() {
Config.config.whitelistedChannels = newChannelList;
}
// Check if off-topic category needs to be removed
for (let i = 0; i < Config.config.categorySelections.length; i++) {
if (Config.config.categorySelections[i].name === "offtopic") {
Config.config.categorySelections.splice(i, 1);
// Call set listener
Config.config.categorySelections = Config.config.categorySelections;
break;
}
}
}
async function setupConfig() {

View File

@@ -1130,13 +1130,16 @@ function getRoughCurrentTime(): number {
let htmlCurrentTimeString = document.querySelector(".ytp-time-current").textContent;
let htmlDurationString = document.querySelector(".ytp-time-duration").textContent;
// Used to check if endscreen content is visible
let endScreenContent = document.querySelector(".ytp-endscreen-content");
// Used to check autoplay display
let autoPlayDisplay: HTMLDivElement = document.querySelector(".ytp-upnext");
if (htmlCurrentTimeString == htmlDurationString) {
// At the end of the video
return video.duration;
}
if (htmlCurrentTimeString == htmlDurationString
|| endScreenContent.childElementCount > 0 || autoPlayDisplay.style.display !== "none") {
// Used to check if replay button
let playButtonSVGData = document.querySelector("ytp-play-button")?.querySelector("ytp-svg-fill")?.getAttribute("d");
let replaceSVGData = "M 18,11 V 7 l -5,5 5,5 v -4 c 3.3,0 6,2.7 6,6 0,3.3 -2.7,6 -6,6 -3.3,0 -6,-2.7 -6,-6 h -2 c 0,4.4 3.6,8 8,8 4.4,0 8,-3.6 8,-8 0,-4.4 -3.6,-8 -8,-8 z";
if (playButtonSVGData === replaceSVGData) {
// At the end of the video
return video.duration;
}