Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/parser/classes/NavigationEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { YTNode } from '../helpers.js';
import { Parser, type IEndpoint, type RawNode } from '../index.js';
import OpenPopupAction from './actions/OpenPopupAction.js';
import CreatePlaylistDialog from './CreatePlaylistDialog.js';
import CommandExecutorCommand from './commands/CommandExecutorCommand.js';

import type Actions from '../../core/Actions.js';
import type ModalWithTitleAndButton from './ModalWithTitleAndButton.js';
Expand Down Expand Up @@ -124,7 +125,12 @@ export default class NavigationEndpoint extends YTNode {
throw new Error('An API caller must be provided');

if (this.command) {
const command = this.command as (YTNode & IEndpoint);
let command = this.command as (YTNode & IEndpoint);

if (command.is(CommandExecutorCommand)) {
command = command.commands.at(-1) as (YTNode & IEndpoint);
}

return actions.execute(command.getApiPath(), { ...command.buildRequest(), ...args });
}

Expand Down