fix(content): audio always plays in the bottom-bar player + ecash purchase is explicit two-step

- Owned/purchased and cloud audio never opens a lightbox: PeerFiles'
  owned-content viewer and the Cloud/CloudFolder preview route audio to the
  global bottom-bar player (video keeps the lightbox).
- Web5 shared-content 'Buy' no longer fires the node-ecash payment on
  click: it opens a confirmation with balance -> price -> balance-after,
  and pays only on explicit confirm.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
archipelago
2026-07-23 15:31:01 -04:00
co-authored by Claude Fable 5
parent 6502f13e29
commit 960e41e164
4 changed files with 82 additions and 14 deletions
+9
View File
@@ -638,6 +638,15 @@ async function handlePlay(path: string, name: string) {
}
function handlePreview(path: string, context: FileBrowserItem[]) {
// Audio never opens the lightbox — it belongs to the bottom-bar player.
const clicked = context.find(item => item.path === path)
if (clicked) {
const ext = clicked.name.includes('.') ? clicked.name.split('.').pop()!.toLowerCase() : ''
if (getFileCategory(ext, clicked.isDir) === 'audio') {
void handlePlay(path, clicked.name)
return
}
}
// MediaLightbox filters to media internally; index within that filtered list.
const mediaItems = context.filter(item => {
const ext = item.name.includes('.') ? item.name.split('.').pop()!.toLowerCase() : ''