Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
fix: GTIN not found error on unpublished drops
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlauer-Hax committed Sep 30, 2024
1 parent fbea44b commit 4568910
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions pages/music/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,21 @@ const streamingImages: Record<string, ImageComponent> = {
const StreamingServiesDialog = SheetDialog(
sheetStack,
"Streaming Services",
await API.music.id(data.id).services().then(stupidErrorAlert).then((x) =>
Vertical(
...Object.entries(x).map(([key, value]) =>
Button("Open in " + key[0].toUpperCase() + key.slice(1))
.onClick(() => globalThis.open(value, "_blank"))
.addPrefix(
streamingImages[key]
.setHeight("1.5rem")
.setWidth("1.5rem")
.setMargin("0 0.35rem 0 -0.3rem"),
)
),
Object.values(x).every((x) => !x) ? Label("No Links available :(").setTextSize("2xl") : Empty(),
).setGap("0.5rem")
),
data.type === "PUBLISHED"
? await API.music.id(data.id).services().then(stupidErrorAlert).then((x) =>
Vertical(
...Object.entries(x).map(([key, value]) =>
Button("Open in " + key[0].toUpperCase() + key.slice(1))
.onClick(() => globalThis.open(value, "_blank"))
.addPrefix(
streamingImages[key]
.setHeight("1.5rem")
.setWidth("1.5rem")
.setMargin("0 0.35rem 0 -0.3rem"),
)
),
Object.values(x).every((x) => !x) ? Label("No Links available :(").setTextSize("2xl") : Empty(),
).setGap("0.5rem")
)
: Empty(),
);

0 comments on commit 4568910

Please sign in to comment.