File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -744,6 +744,8 @@ class ECharts extends Eventful<ECEventDefinition> {
744
744
return ;
745
745
}
746
746
747
+ const backup = typeof this . getOption === 'function' ? this . getOption ( ) : null ;
748
+
747
749
let silent = opts && opts . silent ;
748
750
let updateParams = null as UpdateLifecycleParams ;
749
751
@@ -761,9 +763,6 @@ class ECharts extends Eventful<ECEventDefinition> {
761
763
try {
762
764
this . _updateTheme ( theme ) ;
763
765
ecModel . setTheme ( this . _theme ) ;
764
-
765
- prepare ( this ) ;
766
- updateMethods . update . call ( this , { type : 'setTheme' } , updateParams ) ;
767
766
}
768
767
catch ( e ) {
769
768
this [ IN_MAIN_PROCESS_KEY ] = false ;
@@ -772,6 +771,13 @@ class ECharts extends Eventful<ECEventDefinition> {
772
771
773
772
this [ IN_MAIN_PROCESS_KEY ] = false ;
774
773
774
+ if ( backup ) {
775
+ this . setOption ( backup as any , { notMerge : true , lazyUpdate : false , silent : ! ! silent } ) ;
776
+ return ;
777
+ }
778
+
779
+ prepare ( this ) ;
780
+ updateMethods . update . call ( this , { type : 'setTheme' } , updateParams ) ;
775
781
flushPendingActions . call ( this , silent ) ;
776
782
triggerUpdatedEvent . call ( this , silent ) ;
777
783
}
You can’t perform that action at this time.
0 commit comments