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
+10 -1
View File
@@ -323,9 +323,18 @@ const shareTarget = ref<{ path: string; name: string; isDir: boolean } | null>(n
const lightboxIndex = ref<number | null>(null)
function handlePreview(path: string) {
const items = cloudStore.sortedItems
// Audio never opens the lightbox — it belongs to the bottom-bar player.
const clicked = items.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 internally filters items to media only, so startIndex
// must be the index within that filtered list
const items = cloudStore.sortedItems
const mediaItems = items.filter(item => {
const ext = item.name.includes('.') ? item.name.split('.').pop()!.toLowerCase() : ''
const cat = getFileCategory(ext, item.isDir)