fix(VideoAttributeView): Parse secondarySubtitle only if exists

This commit is contained in:
Luan
2024-11-09 16:36:40 -03:00
parent e4ca991d30
commit 0a99342ccb

View File

@@ -14,7 +14,7 @@ export default class VideoAttributeView extends YTNode {
image_style: string;
title: string;
subtitle: string;
secondary_subtitle: {
secondary_subtitle?: {
content: string
};
orientation: string;
@@ -34,9 +34,13 @@ export default class VideoAttributeView extends YTNode {
this.image_style = data.imageStyle;
this.title = data.title;
this.subtitle = data.subtitle;
this.secondary_subtitle = {
content: data.secondarySubtitle.content
};
if (Reflect.has(data, 'secondarySubtitle')) {
this.secondary_subtitle = {
content: data.secondarySubtitle.content
};
}
this.orientation = data.orientation;
this.sizing_rule = data.sizingRule;
this.overflow_menu_on_tap = new NavigationEndpoint(data.overflowMenuOnTap);