diff options
-rw-r--r-- | src/components/CategorySkipOptionsComponent.tsx | 4 | ||||
-rw-r--r-- | src/js-components/previewBar.ts | 2 | ||||
-rw-r--r-- | src/popup.ts | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/components/CategorySkipOptionsComponent.tsx b/src/components/CategorySkipOptionsComponent.tsx index 3cc03527..a59e3f54 100644 --- a/src/components/CategorySkipOptionsComponent.tsx +++ b/src/components/CategorySkipOptionsComponent.tsx @@ -21,8 +21,8 @@ class CategorySkipOptionsComponent extends React.Component<CategorySkipOptionsPr // Setup state this.state = { - color: props.defaultColor || Config.config.barTypes[this.props.category].color, - previewColor: props.defaultPreviewColor || Config.config.barTypes["preview-" + this.props.category].color, + color: props.defaultColor || Config.config.barTypes[this.props.category]?.color, + previewColor: props.defaultPreviewColor || Config.config.barTypes["preview-" + this.props.category]?.color, } } diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts index 7f011f0d..67d28c1a 100644 --- a/src/js-components/previewBar.ts +++ b/src/js-components/previewBar.ts @@ -194,7 +194,7 @@ class PreviewBar { bar.setAttribute('data-vs-segment-type', barSegmentType); - bar.style.backgroundColor = Config.config.barTypes[barSegmentType].color; + bar.style.backgroundColor = Config.config.barTypes[barSegmentType]?.color; if (!this.onMobileYouTube) bar.style.opacity = Config.config.barTypes[barSegmentType].opacity; bar.style.position = "absolute"; diff --git a/src/popup.ts b/src/popup.ts index 7ae6f6d5..5a9cc8be 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -374,7 +374,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> { const categoryColorCircle = document.createElement("span"); categoryColorCircle.id = "sponsorTimesCategoryColorCircle" + UUID; - categoryColorCircle.style.backgroundColor = Config.config.barTypes[segmentTimes[i].category].color; + categoryColorCircle.style.backgroundColor = Config.config.barTypes[segmentTimes[i].category]?.color; categoryColorCircle.classList.add("dot"); categoryColorCircle.classList.add("sponsorTimesCategoryColorCircle"); |