File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,8 @@ export class Draw {
143143 private intersectionPageNo : number
144144 private lazyRenderIntersectionObserver : IntersectionObserver | null
145145
146+ private isDestroyed : boolean = false ;
147+
146148 constructor (
147149 rootContainer : HTMLElement ,
148150 options : DeepRequired < IEditorOption > ,
@@ -357,6 +359,7 @@ export class Draw {
357359 }
358360
359361 public setIntersectionPageNo ( payload : number ) {
362+ if ( this . isDestroyed ) return ;
360363 this . intersectionPageNo = payload
361364 if ( this . listener . intersectionPageNoChange ) {
362365 this . listener . intersectionPageNoChange ( this . intersectionPageNo )
@@ -1716,6 +1719,7 @@ export class Draw {
17161719 }
17171720
17181721 public render ( payload ?: IDrawOption ) {
1722+ if ( this . isDestroyed ) return ;
17191723 const { header, footer } = this . options
17201724 const {
17211725 isSubmitHistory = true ,
@@ -1849,6 +1853,7 @@ export class Draw {
18491853 }
18501854
18511855 public destroy ( ) {
1856+ this . isDestroyed = true ;
18521857 this . container . remove ( )
18531858 this . globalEvent . removeEvent ( )
18541859 this . scrollObserver . removeEvent ( )
Original file line number Diff line number Diff line change @@ -318,6 +318,7 @@ export class RangeManager {
318318 }
319319
320320 public setRangeStyle ( ) {
321+ if ( ! this . eventBus || ! this . listener ) return ;
321322 const rangeStyleChangeListener = this . listener . rangeStyleChange
322323 const isSubscribeRangeStyleChange =
323324 this . eventBus . isSubscribe ( 'rangeStyleChange' )
You can’t perform that action at this time.
0 commit comments