mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-13 15:07:02 +03:00
Fixed sponsor times not properly saving
This commit is contained in:
10
popup.js
10
popup.js
@@ -209,7 +209,9 @@ function runThePopup() {
|
||||
function onTabs(tabs) {
|
||||
chrome.tabs.sendMessage(tabs[0].id, {message: 'getVideoID'}, function(result) {
|
||||
if (result != undefined && result.videoID) {
|
||||
loadTabData(tabs, result.videoID);
|
||||
currentVideoID = result.videoID;
|
||||
|
||||
loadTabData(tabs);
|
||||
} else if (result == undefined && chrome.runtime.lastError) {
|
||||
//this isn't a YouTube video then, or at least the content script is not loaded
|
||||
displayNoVideo();
|
||||
@@ -217,15 +219,15 @@ function runThePopup() {
|
||||
});
|
||||
}
|
||||
|
||||
function loadTabData(tabs, videoID) {
|
||||
if (!videoID) {
|
||||
function loadTabData(tabs) {
|
||||
if (!currentVideoID) {
|
||||
//this isn't a YouTube video then
|
||||
displayNoVideo();
|
||||
return;
|
||||
}
|
||||
|
||||
//load video times for this video
|
||||
let sponsorTimeKey = "sponsorTimes" + videoID;
|
||||
let sponsorTimeKey = "sponsorTimes" + currentVideoID;
|
||||
chrome.storage.sync.get([sponsorTimeKey], function(result) {
|
||||
let sponsorTimesStorage = result[sponsorTimeKey];
|
||||
if (sponsorTimesStorage != undefined && sponsorTimesStorage.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user