Skip to content

Commit

Permalink
commented out auto save and entities-mto reduce some of the convertFr…
Browse files Browse the repository at this point in the history
…omRaw function calls
  • Loading branch information
Pietro Passarelli committed Mar 12, 2020
1 parent e78696c commit d974cfe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
20 changes: 10 additions & 10 deletions packages/components/timed-text-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ class TimedTextEditor extends React.Component {
}),
() => {
// const data = this.updateTimestampsForEditorState();
const data = this.getEditorContent( this.props.autoSaveContentType, this.props.title);
this.props.handleAutoSaveChanges(data);
// const data = this.getEditorContent( this.props.autoSaveContentType, this.props.title);
// this.props.handleAutoSaveChanges(data);
}
);
}, 1000);
Expand Down Expand Up @@ -273,16 +273,16 @@ class TimedTextEditor extends React.Component {
editorState
}),
() => {
const format = this.props.autoSaveContentType;
const title = this.props.title;
// const format = this.props.autoSaveContentType;
// const title = this.props.title;

const data = exportAdapter(
convertToRaw(editorState.getCurrentContent()),
format,
title
);
// const data = exportAdapter(
// convertToRaw(editorState.getCurrentContent()),
// format,
// title
// );

this.props.handleAutoSaveChanges(data);
// this.props.handleAutoSaveChanges(data);
}
);
};
Expand Down
18 changes: 9 additions & 9 deletions packages/stt-adapters/create-entity-map/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ const flatten = list => list.reduce((a, b) => a.concat(Array.isArray(b) ? flatte
* @param {*} blocks - draftJs blocks
*/
const createEntityMap = (blocks) => {
const entityRanges = blocks.map(block => block.entityRanges);
const flatEntityRanges = flatten(entityRanges);
// const entityRanges = blocks.map(block => block.entityRanges);
// const flatEntityRanges = flatten(entityRanges);

const entityMap = {};

flatEntityRanges.forEach((data) => {
entityMap[data.key] = {
type: 'WORD',
mutability: 'MUTABLE',
data,
};
});
// flatEntityRanges.forEach((data) => {
// entityMap[data.key] = {
// type: 'WORD',
// mutability: 'MUTABLE',
// data,
// };
// });

return entityMap;
};
Expand Down

0 comments on commit d974cfe

Please sign in to comment.