-
Notifications
You must be signed in to change notification settings - Fork 170
Description
Describe the bug
A clear and concise description of what the bug is.
The component at a minimum needs two params to function properly and to be able to save to local storage:
- media
mediaUrl - transcript
transcriptData(+ type)
as background saving to local storage uses the media url as a key.
-
Providing both at the same time <-- works
-
Providing first media then transcript <-- works
-
First transcript then media <-- breaks
To Reproduce
Steps to reproduce the behavior:
- Go to https://bbc.github.io/react-transcript-editor/
- Click on 'choose file' next to 'open Transcript Json'
- Click on 'choose file' Load Local Media'
- Click on text and edit, (add more then 5 char)
- refresh page
- repeat 1-5 and see the text added in step 4 is present
- if not, then this is the error
Expected behavior
A clear and concise description of what you expected to happen.
It would be preferable if the component could handle local storage save even if transcript is provided before the media is passed to it.
Additional context
Add any other context about the problem here.
Possible solution if Media not defined then transcript should wait to load until media is. Binding TranscriptEditor component to only work if both are present. this would also address #85