fix(downloads): carry the active account on the Library poster URL
An <img> can't send the X-Siftlode-Account header, so the poster.jpg request resolved to the session-default account and _accessible_job 404'd it for any download owned by a different (per-tab) account — every card then fell back to the source's remote thumbnail, which for Facebook is an expiring fbcdn URL, so the Library showed blank thumbnails in a multi-account session. The 0.69.1 local-poster-primary change made this the primary image, exposing it broadly. Append ?account= to the poster URL via a new api.posterImageUrl(), the same wallet-gated header-less selection downloadFileUrl / storyboardImageUrl already use (resolved_user_id reads ?account= for exactly these contexts).
This commit is contained in:
@@ -225,6 +225,15 @@ export const downloadsApi = {
|
||||
? `/api/downloads/${id}/storyboard.jpg?account=${a}`
|
||||
: `/api/downloads/${id}/storyboard.jpg`;
|
||||
},
|
||||
// The locally-generated poster (an <img> src → direct nav, so same ?account= wallet gate). Without
|
||||
// it the poster resolves to the session-default account and 404s for a per-tab account's download —
|
||||
// which reads as a blank Library thumbnail once the poster is the card's primary image.
|
||||
posterImageUrl: (id: number): string => {
|
||||
const a = getActiveAccount();
|
||||
return a != null
|
||||
? `/api/downloads/${id}/poster.jpg?account=${a}`
|
||||
: `/api/downloads/${id}/poster.jpg`;
|
||||
},
|
||||
|
||||
// admin
|
||||
adminDownloads: (): Promise<DownloadJob[]> => req("/api/admin/downloads"),
|
||||
|
||||
Reference in New Issue
Block a user