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:
co-authored by
Claude Fable 5
parent
6502f13e29
commit
960e41e164
@@ -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() : ''
|
||||
|
||||
Reference in New Issue
Block a user