audio streaming app plyr.fm
38
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(album-upload): use canonical album route in success toast (#1349)

after a successful album upload, the "view album" action in the toast
linked to `/album/${albumSlug}`, but no such route exists — the actual
album route is `/u/[handle]/album/[slug]`. tapping the action 404s
right after a successful publish, which is the worst possible time
for a broken link.

include `artistProfile.handle` (already loaded on mount) in the link.
if the profile fetch failed and we don't have a handle, omit the
action entirely rather than offering a guaranteed-404.

closes #1343

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>

authored by

nate nowack
Claude Opus 4 (1M context)
and committed by
GitHub
1f0804f6 5dc1f048

+7 -2
+7 -2
frontend/src/lib/components/AlbumUploadForm.svelte
··· 380 380 await onAlbumsReload(); 381 381 382 382 if (completed > 0) { 383 + // only offer the "view album" action when we know the artist handle — 384 + // the canonical album route is `/u/[handle]/album/[slug]`, so without 385 + // a handle the link would 404. artistProfile is loaded on mount but 386 + // may be null if the profile fetch failed. 387 + const artistHandle = artistProfile?.handle; 383 388 toast.success( 384 389 `${completed} of ${tracks.length} track${tracks.length > 1 ? 's' : ''} uploaded`, 385 390 5000, 386 - albumSlug 391 + albumSlug && artistHandle 387 392 ? { 388 393 label: 'view album', 389 - href: `/album/${albumSlug}`, 394 + href: `/u/${artistHandle}/album/${albumSlug}`, 390 395 } 391 396 : undefined, 392 397 );