Skip to content

Commit

Permalink
Merge pull request #67 from AirWalk-Digital/fix-blankeditor
Browse files Browse the repository at this point in the history
Feat: Fix blankeditor
  • Loading branch information
rob-at-airwalk authored Jul 16, 2024
2 parents 3679fbb + 31eaa76 commit 955a3bc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/_components/Editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,20 @@ const Editor = React.memo(function EditorC({
doc
);

provider.on('status', (event: { status: string }) => {
if (
event.status === 'connecting' ||
event.status === 'disconnected'
) {
if (editorRef && editorRef.current) {
editorRef.current.setMarkdown(initialMarkdown);
logger.error(
'Websockets failed, setting initial content'
);
}
}
});

provider.on('synced', () => {
// The 'synced' event ensures all data has been loaded
// initializeDocument(doc, initialMarkdown, editorRef);
Expand Down

0 comments on commit 955a3bc

Please sign in to comment.