Skip to content

ShouldAddCallback

ShouldAddCallback runs each time the menu opens and returns true to show the item or submenu.

type ShouldAddCallback = (uris: string[], uids?: string[], contextUri?: string) => boolean;

It receives the same arguments as OnClickCallback.

const isSingleTrack: Spicetify.ContextMenu.ShouldAddCallback = (uris) =>
uris.length === 1 && Spicetify.URI.isTrack(uris[0]);