Browse Source

Added a useful example to docs. [skip ci]

Maciej Bukowski 6 years ago
parent
commit
fec0b83a30
1 changed files with 4 additions and 0 deletions
  1. 4 0
      packages/ckeditor5-watchdog/docs/features/watchdog.md

+ 4 - 0
packages/ckeditor5-watchdog/docs/features/watchdog.md

@@ -107,6 +107,10 @@ watchdog.state;
 // Listen to state changes.
 watchdog.on( 'change:state' ( evt, name, currentState, prevState ) => {
 	console.log( `Editor changed from ${ currentState } to ${ prevState }` );
+
+	if ( currentState === 'crashedPermanently' ) {
+		watchdog.editor.isReadOnly = true;
+	}
 } );
 
 // An array of editor crashes info.