Conversation
|
|
||
| deprecated: [ | ||
| { | ||
| save: () => ( <figure><audio controls /></figure> ), |
There was a problem hiding this comment.
This one is weird though :) shouldn't we copy the previous save function as is?
codebykat
left a comment
There was a problem hiding this comment.
Hi @Soean! I tested this and verified that it works! ✨
For anyone else looking at this, since it's hooked to post save, not view, the testing steps are a bit off -- you have to save a post with an empty audio block.
I'm curious about the logic of doing it on save rather than on post view -- couldn't we add it to the view in order to fix any pre-existing posts without an audio source?
It also looks like there's one clarifying question from @youknowriad that would need to be addressed before we can move this forward.
|
What's the status of this pull request? Are you able to revisit it in mind of the recent review comments? |
Description
The HTML audio element should just be rendered if there is a source file. We already have the same behavior in the Video block. This could be useful, if you use the Audio Block in a template and don't select a audio file.
For already created Audio blocks with no source file, we need the deprecated function.
Test:
Fixes #13556