Skip to content

Commit

Permalink
fix: integration composer
Browse files Browse the repository at this point in the history
  • Loading branch information
nubsthead committed Jul 26, 2022
1 parent 39a8aa5 commit ed0ad0f
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/store/integrations/composer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,16 @@ const Composer: FC<ComposerProps> = ({
initialValue,
...rest
}) => {
const [content, setContent] = useState(initialValue);

const _onEditorChange = useCallback(
(newContent, editor) => {
setContent(newContent);
onEditorChange?.([
editor.getContent({ format: 'text' }),
editor.getContent({ format: 'html' })
]);
},
[setContent, onEditorChange]
[onEditorChange]
);

useEffect(() => {
if (value) {
setContent(value);
}
}, [value]);

return (
<Container
height="100%"
Expand All @@ -92,7 +83,8 @@ const Composer: FC<ComposerProps> = ({
style={{ overflowY: 'hidden' }}
>
<Editor
value={content}
initialValue={initialValue}
value={value}
init={{
skin_url: `${baseAssetsUrl}/tinymce/skins/ui/oxide`,
content_css: `${baseAssetsUrl}/tinymce/skins/content/default/content.css`,
Expand Down

0 comments on commit ed0ad0f

Please sign in to comment.