mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 14:37:23 +03:00
Enable chapters if not enabled after redeem successful
This commit is contained in:
@@ -3,11 +3,15 @@ import { checkLicenseKey } from "./utils/licenseKey";
|
|||||||
import { localizeHtmlPage } from "./utils/pageUtils";
|
import { localizeHtmlPage } from "./utils/pageUtils";
|
||||||
|
|
||||||
import * as countries from "../public/res/countries.json";
|
import * as countries from "../public/res/countries.json";
|
||||||
|
import Utils from "./utils";
|
||||||
|
import { Category, CategorySkipOption } from "./types";
|
||||||
|
|
||||||
// This is needed, if Config is not imported before Utils, things break.
|
// This is needed, if Config is not imported before Utils, things break.
|
||||||
// Probably due to cyclic dependencies
|
// Probably due to cyclic dependencies
|
||||||
Config.config;
|
Config.config;
|
||||||
|
|
||||||
|
const utils = new Utils();
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', init);
|
window.addEventListener('DOMContentLoaded', init);
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
@@ -31,6 +35,13 @@ async function init() {
|
|||||||
Config.config.payments.licenseKey = licenseKey;
|
Config.config.payments.licenseKey = licenseKey;
|
||||||
Config.forceSyncUpdate("payments");
|
Config.forceSyncUpdate("payments");
|
||||||
|
|
||||||
|
if (!utils.getCategorySelection("chapter")) {
|
||||||
|
Config.config.categorySelections.push({
|
||||||
|
name: "chapter" as Category,
|
||||||
|
option: CategorySkipOption.ShowOverlay
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
alert(chrome.i18n.getMessage("redeemSuccess"));
|
alert(chrome.i18n.getMessage("redeemSuccess"));
|
||||||
} else {
|
} else {
|
||||||
alert(chrome.i18n.getMessage("redeemFailed"));
|
alert(chrome.i18n.getMessage("redeemFailed"));
|
||||||
|
|||||||
Reference in New Issue
Block a user