How to use the ember-inspector/config/environment.previousEmberVersionsSupported function in ember-inspector

To help you get started, we’ve selected a few ember-inspector examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github emberjs / ember-inspector / app / adapters / basic.js View on Github external
this.onMessageReceived(message => {
      let { name, version } = message;
      if (name === 'version-mismatch') {
        let previousVersions = config.previousEmberVersionsSupported;
        let [fromVersion, tillVersion] = config.emberVersionsSupported;
        let neededVersion;

        if (compareVersion(version, fromVersion) === -1) {
          neededVersion = previousVersions[previousVersions.length - 1];
        } else if (tillVersion && compareVersion(version, tillVersion) !== -1) {
          neededVersion = tillVersion;
        } else {
          return;
        }
        this.onVersionMismatch(neededVersion);
      }
    });
    this.sendMessage({ type: 'check-version', from: 'devtools' });