Skip to content

Commit

Permalink
fix(parser): Fix ShortsLockupView assuming that the primary text alwa…
Browse files Browse the repository at this point in the history
…ys exists (#775)
  • Loading branch information
absidue authored Oct 7, 2024
1 parent 5ff30e1 commit 43cef9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parser/classes/ShortsLockupView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class ShortsLockupView extends YTNode {
index_in_collection: number;
menu_on_tap_a11y_label: string;
overlay_metadata: {
primary_text: Text;
primary_text?: Text;
secondary_text?: Text;
};
inline_player_data?: NavigationEndpoint;
Expand All @@ -35,7 +35,7 @@ export default class ShortsLockupView extends YTNode {
this.menu_on_tap_a11y_label = data.menuOnTapA11yLabel;

this.overlay_metadata = {
primary_text: Text.fromAttributed(data.overlayMetadata.primaryText),
primary_text: data.overlayMetadata.primaryText ? Text.fromAttributed(data.overlayMetadata.primaryText) : undefined,
secondary_text: data.overlayMetadata.secondaryText ? Text.fromAttributed(data.overlayMetadata.secondaryText) : undefined
};

Expand Down

0 comments on commit 43cef9e

Please sign in to comment.