Skip to content

If initialising component with Transcript first and then Media local storage save/retrieve does not work #87

@pietrop

Description

@pietrop

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:

  1. Go to https://bbc.github.io/react-transcript-editor/
  2. Click on 'choose file' next to 'open Transcript Json'
  3. Click on 'choose file' Load Local Media'
  4. Click on text and edit, (add more then 5 char)
  5. refresh page
  6. repeat 1-5 and see the text added in step 4 is present
  7. 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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions