1- import { Snapshot , Settings , ButtonTone , ButtonRenderOptions } from "./types" ;
2- import { loadSnapshots , pruneAutosToMax , saveSettings , saveSnapshots } from "./storage" ;
1+ import "./ui.css" ;
2+
3+ import { Snapshot , Settings , ButtonRenderOptions , BadgeVariant } from "./types" ;
4+ import { loadSnapshots , pruneAutosToMax , saveSnapshots } from "./storage" ;
35import { getSnapshotItemNames , getSnapshotDisplayName } from "./names" ;
46import { escapeHtml , downloadJson , setButtonLabel } from "./utils" ;
57import { createManualSnapshot , exportSnapshotToPlaylist } from "./exporter" ;
68import { replaceQueueWithSnapshot } from "./exporter" ;
79import { APP_CHANNEL , APP_NAME , APP_VERSION } from "./appInfo" ;
8- import "./ui.css" ;
910import { getSortedSnapshots } from "./storage" ;
1011
1112export type UIHandlers = {
@@ -45,8 +46,6 @@ function renderActionIconButton(action: string, icon: Spicetify.Icon, title: str
4546 return `<button type="button" class="qs-icon-btn" data-action="${ escapeHtml ( action ) } " title="${ escapeHtml ( title ) } ">${ getIconMarkup ( icon ) } </button>` ;
4647}
4748
48- type BadgeVariant = "default" | "accent" | "version" | "channel" ;
49-
5049function renderBadge ( text : string , variant : BadgeVariant = "default" ) : string {
5150 const classes = [ "qs-pill" ] ;
5251 if ( variant !== "default" ) {
@@ -345,7 +344,6 @@ export function openManagerModal(ui: UIHandlers): void {
345344 if ( ! action ) return ;
346345
347346 if ( action === "toggle-items" ) {
348- e . preventDefault ( ) ;
349347 const itemsEl = rowEl . nextElementSibling as HTMLElement | null ;
350348 const btn = clickedButton ;
351349 if ( ! itemsEl || ! itemsEl . classList . contains ( "qs-items" ) ) return ;
@@ -371,19 +369,16 @@ export function openManagerModal(ui: UIHandlers): void {
371369 }
372370 return ;
373371 }
374-
375372 if ( action === "export" ) {
376373 if ( exportingIds . has ( id ) ) return ;
377374 exportingIds . add ( id ) ;
378- const btn = clickedButton ;
379- await exportSnapshotToPlaylist ( snap , btn ) ;
375+ await exportSnapshotToPlaylist ( snap , clickedButton ) ;
380376 exportingIds . delete ( id ) ;
381377 return ;
382378 }
383379 if ( action === "replace-queue" ) {
384380 if ( exportingIds . has ( id ) ) return ;
385381 exportingIds . add ( id ) ;
386- const btn = clickedButton ;
387382 try {
388383 const settings = ui . getSettings ( ) ;
389384 if ( settings . promptManualBeforeReplace ) {
@@ -393,7 +388,7 @@ export function openManagerModal(ui: UIHandlers): void {
393388 renderList ( ) ;
394389 }
395390 }
396- await replaceQueueWithSnapshot ( snap , btn ) ;
391+ await replaceQueueWithSnapshot ( snap , clickedButton ) ;
397392 } finally {
398393 exportingIds . delete ( id ) ;
399394 }
0 commit comments