@@ -40,6 +40,7 @@ Entry.Thread = class Thread {
4040 if ( codeView ) {
4141 this . createView ( codeView . board , mode ) ;
4242 }
43+ this . resetEvent ( ) ;
4344 return this ;
4445 }
4546
@@ -78,11 +79,13 @@ Entry.Thread = class Thread {
7879 }
7980
8081 this . _code . createThread ( this . _data . splice ( this . _data . indexOf ( block ) , count ) , index ) ;
82+ this . resetEvent ( ) ;
8183 this . changeEvent . notify ( ) ;
8284 }
8385
8486 cut ( block ) {
8587 const splicedData = this . _data . splice ( this . _data . indexOf ( block ) ) ;
88+ this . resetEvent ( ) ;
8689 this . changeEvent . notify ( ) ;
8790 return splicedData ;
8891 }
@@ -93,12 +96,14 @@ Entry.Thread = class Thread {
9396 newBlocks [ i ] . setThread ( this ) ;
9497 }
9598 this . _data . splice ( ...[ index + 1 , 0 ] . concat ( newBlocks ) ) ;
99+ this . resetEvent ( ) ;
96100 this . changeEvent . notify ( ) ;
97101 }
98102
99103 insertToTop ( newBlock ) {
100104 newBlock . setThread ( this ) ;
101105 this . _data . unshift . apply ( this . _data , [ newBlock ] ) ;
106+ this . resetEvent ( ) ;
102107 this . changeEvent . notify ( ) ;
103108 }
104109
@@ -181,6 +186,7 @@ Entry.Thread = class Thread {
181186
182187 spliceBlock ( block ) {
183188 this . _data . remove ( block ) ;
189+ this . resetEvent ( ) ;
184190 this . changeEvent . notify ( ) ;
185191 }
186192
@@ -330,4 +336,11 @@ Entry.Thread = class Thread {
330336 hasData ( ) {
331337 return Boolean ( this . _data . length ) ;
332338 }
339+
340+ resetEvent ( ) {
341+ const block = this . getFirstBlock ( ) ;
342+ if ( block && this . _event !== block ?. _schema ?. event ) {
343+ this . _event = block ?. _schema ?. event ;
344+ }
345+ }
333346} ;
0 commit comments