@@ -2,7 +2,6 @@ import { connectRouter } from 'connected-react-router';
22import { combineReducers } from 'redux' ;
33
44import { Action , ActionType , FileImportArgs } from './actions' ;
5- import { DEMO_CODE } from '../editor/props' ;
65import { EditorState , SettingsState , State , StatusState } from './state' ;
76import { CompilerResponse } from '../services/api' ;
87import localConfig from '../services/config'
@@ -29,7 +28,7 @@ const reducers = {
2928
3029 return s ;
3130 } ,
32- } , { fileName : 'main.go' , code : DEMO_CODE } ) ,
31+ } , { fileName : 'main.go' , code : '' } ) ,
3332 status : mapByAction < StatusState > ( {
3433 [ ActionType . COMPILE_RESULT ] : ( s : StatusState , a : Action < CompilerResponse > ) => {
3534 return {
@@ -38,6 +37,9 @@ const reducers = {
3837 events : a . payload . events ,
3938 }
4039 } ,
40+ [ ActionType . IMPORT_FILE ] : ( s : StatusState , a : Action < string > ) => {
41+ return { ...s , loading : false }
42+ } ,
4143 [ ActionType . COMPILE_FAIL ] : ( s : StatusState , a : Action < string > ) => {
4244 return { ...s , loading : false , lastError : a . payload }
4345 } ,
@@ -56,11 +58,11 @@ const reducers = {
5658
5759export const getInitialState = ( ) : State => ( {
5860 status : {
59- loading : false
61+ loading : true
6062 } ,
6163 editor : {
6264 fileName : 'prog.go' ,
63- code : DEMO_CODE
65+ code : ''
6466 } ,
6567 settings : {
6668 darkMode : localConfig . darkThemeEnabled
0 commit comments