Skip to content

Commit

Permalink
Use this.project.config over configCache
Browse files Browse the repository at this point in the history
  • Loading branch information
thoov committed Mar 7, 2018
1 parent 67fb6c7 commit f7767c8
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,14 @@ module.exports = {
included() {
this._super.included.apply(this, arguments);

const config = this.project.configCache;
const env = this.app.env;

// This configures EmberENV in a "hacky" way as the 'config' hook is called
// before the options from EmberApp are provided. There currently is no way of handling
// this case other than manually messing with configCache or modifing the dom by setting
// up window.EmberENV before ember loads.
if (!config.get(env)) {
config.set(env, this.project.configWithoutCache(env));
}

Object.keys(flagToEnvironment).forEach(flag => {
config.get(env).EmberENV[flagToEnvironment[flag]] = this.flagValue(flag);
this.project.config(env).EmberENV[flagToEnvironment[flag]] = this.flagValue(flag);
});

// Always register the version
Expand Down

0 comments on commit f7767c8

Please sign in to comment.