snowkit / atom-flow

atom.io support for haxe flow build tool
MIT License
6 stars 5 forks source link

Setting the default target to "web" doesn't have any effect #10

Closed prime31 closed 9 years ago

prime31 commented 9 years ago

The expected result is that any new Luxe projects opened up

Steps to reproduce:

This seems to be due to the preference never being read. It can be fixed by changing the init method of the flow-state.js file to be the following:

    init:function(state) {

        if( state.target == null )
        {
            var defaultTarget = atom.config.get( 'flow.flow_default_target' );
            if( defaultTarget != null && defaultTarget.length > 0 )
            {
                state.target = defaultTarget;
                log.debug( 'no serialized target available so defaulting to the target set in preferences: ' + state.target );
            }
        }

        this.system = this.get_system();

        this.set(state);

        log.debug('state:' + JSON.stringify(this));

    },