diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 4aba4755..265fca26 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -510,5 +510,8 @@ }, "manualSkip": { "message": "Manual Skip" + }, + "showOverlay": { + "message": "Show Overlay On Player" } } diff --git a/src/components/CategorySkipOptionsComponent.tsx b/src/components/CategorySkipOptionsComponent.tsx index e0604418..58301d7b 100644 --- a/src/components/CategorySkipOptionsComponent.tsx +++ b/src/components/CategorySkipOptionsComponent.tsx @@ -1,6 +1,7 @@ import * as React from "react"; import Config from "../config" +import { CategorySkipOption } from "../types"; export interface CategorySkipOptionsProps { category: string; @@ -27,7 +28,17 @@ class CategorySkipOptionsComponent extends React.Component): void { + let option: CategorySkipOption; + + this.removeCurrentCategorySelection(); + switch (event.target.value) { case "disable": - this.removeCurrentCategorySelection(); + return; + case "showOverlay": + option = CategorySkipOption.ShowOverlay; break; - default: - this.removeCurrentCategorySelection(); + case "manualSkip": + option = CategorySkipOption.ManualSkip; - Config.config.categorySelections.push({ - name: this.props.category, - autoSkip: event.target.value === "autoSkip" - }); + break; + case "autoSkip": + option = CategorySkipOption.AutoSkip; - // Forces the Proxy to send this to the chrome storage API - Config.config.categorySelections = Config.config.categorySelections; + break; } + + Config.config.categorySelections.push({ + name: this.props.category, + option: option + }); + + // Forces the Proxy to send this to the chrome storage API + Config.config.categorySelections = Config.config.categorySelections; } /** Removes this category from the config list of category selections */ @@ -89,8 +112,8 @@ class CategorySkipOptionsComponent extends React.Component