@@ -223,7 +223,7 @@ function RapidEditor({
223
223
224
224
useEffect ( ( ) => {
225
225
const containerRoot = document . getElementById ( 'rapid-container-root' ) ;
226
- const editListener = ( ) => updateDisableState ( setDisable , context . systems . edits ) ;
226
+ const editListener = ( ) => updateDisableState ( setDisable , context . systems . editor ) ;
227
227
if ( context && dom ) {
228
228
containerRoot . appendChild ( dom ) ;
229
229
// init the ui or restart if it was loaded previously
@@ -240,19 +240,19 @@ function RapidEditor({
240
240
/* Perform tasks after Rapid has started up */
241
241
promise . then ( ( ) => {
242
242
/* Keep track of edits */
243
- const editSystem = context . systems . edits ;
243
+ const editSystem = context . systems . editor ;
244
244
245
- editSystem . on ( 'change ' , editListener ) ;
245
+ editSystem . on ( 'stablechange ' , editListener ) ;
246
246
editSystem . on ( 'reset' , editListener ) ;
247
247
} ) ;
248
248
}
249
249
return ( ) => {
250
250
if ( containerRoot ?. childNodes && dom in containerRoot . childNodes ) {
251
251
document . getElementById ( 'rapid-container-root' ) ?. removeChild ( dom ) ;
252
252
}
253
- if ( context ?. systems ?. edits ) {
254
- const editSystem = context . systems . edits ;
255
- editSystem . off ( 'change ' , editListener ) ;
253
+ if ( context ?. systems ?. editor ) {
254
+ const editSystem = context . systems . editor ;
255
+ editSystem . off ( 'stablechange ' , editListener ) ;
256
256
editSystem . off ( 'reset' , editListener ) ;
257
257
}
258
258
} ;
0 commit comments