File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
components/caption-studio Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,10 @@ class CaptionManager {
7474 store . dispatch ( 'setIsUnsavedChanges' , { isUnsavedChanges : true } ) ;
7575 }
7676
77+ // reset the data obect everytime the JSON updates rather than just update the captions that need it
78+ // because otherwise when the editor is in "code" mode, any deletions will get overwritten
79+ this . data = { } ;
80+
7781 Object . keys ( $event ) . forEach ( ( key ) => {
7882 $event [ key ] . forEach ( ( caption , index ) => {
7983
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ export default {
8686 currentMode: ' form' ,
8787 options: {
8888 onChangeText: this .onEdit ,
89- modes: [ ' form' , ' code' ],
89+ modes: [ ' form' , ' code' ],
9090 onEvent: this .onEvent ,
9191 onModeChange: this .onModeChange ,
9292 },
@@ -153,7 +153,9 @@ export default {
153153 } catch {
154154 return ;
155155 }
156+
156157 this .checkErrors (parsed, this .origin );
158+
157159 if (this .jsonErrors ) {
158160 return ;
159161 }
You can’t perform that action at this time.
0 commit comments