File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -64,9 +64,11 @@ export function updateSandboxPackage({ state }) {
6464
6565export function setModuleSaved ( { props, state } ) {
6666 const changedModuleShortids = state . get ( 'editor.changedModuleShortids' ) ;
67- const indexToRemove = changedModuleShortids . indexOf ( props . shortid ) ;
67+ const newChangedModuleShortids = changedModuleShortids . filter (
68+ x => x !== props . shortid
69+ ) ;
6870
69- state . splice ( 'editor.changedModuleShortids' , indexToRemove , 1 ) ;
71+ state . set ( 'editor.changedModuleShortids' , newChangedModuleShortids ) ;
7072}
7173
7274export function setModuleSavedCode ( { props, state } ) {
@@ -304,7 +306,12 @@ export function addChangedModule({ state, props }) {
304306 state . push ( 'editor.changedModuleShortids' , moduleShortid ) ;
305307 }
306308 } else if ( module . savedCode === module . code ) {
307- state . splice ( 'editor.changedModuleShortids' , moduleIndex , 1 ) ;
309+ state . set (
310+ 'editor.changedModuleShortids' ,
311+ state
312+ . get ( 'editor.changedModuleShortids' )
313+ . filter ( x => x !== moduleShortid )
314+ ) ;
308315 }
309316 }
310317}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ function getMode(title: string) {
2121 }
2222
2323 if ( / \. j s o n $ / . test ( title ) ) {
24- return 'json ' ;
24+ return 'babylon ' ;
2525 }
2626
2727 if ( / \. c s s $ / . test ( title ) ) {
You can’t perform that action at this time.
0 commit comments