Skip to content

Commit

Permalink
fix deprecation computed-property.override by adding setters
Browse files Browse the repository at this point in the history
  • Loading branch information
kturney committed Mar 23, 2020
1 parent a6eef67 commit fea8520
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 18 deletions.
10 changes: 8 additions & 2 deletions addon/components/docs-viewer/x-nav/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ export default Component.extend({
/*
This is overwritten for the Sandbox.
*/
project: computed(function() {
return this.get('store').peekRecord('project', projectName);
project: computed({
get() {
return this.get('store').peekRecord('project', projectName);
},

set(key, val) {
return val;
}
})
});
37 changes: 21 additions & 16 deletions addon/services/project-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,27 @@ export default Service.extend({
return rootURL.replace(`/${this.get('currentVersion.path')}/`, '/');
}),

currentVersion: computed(function() {
let config = getOwner(this).resolveRegistration('config:environment')['ember-cli-addon-docs'];
let currentVersion = config.deployVersion;

// In development, this token won't have been replaced replaced
if (currentVersion === 'ADDON_DOCS_DEPLOY_VERSION') {
currentVersion = {
key: latestVersionName,
name: latestVersionName,
tag: config.projectTag,
path: '',
sha: 'abcde'
};
}
currentVersion: computed({
get() {
let config = getOwner(this).resolveRegistration('config:environment')['ember-cli-addon-docs'];
let currentVersion = config.deployVersion;

return currentVersion;
})
// In development, this token won't have been replaced replaced
if (currentVersion === 'ADDON_DOCS_DEPLOY_VERSION') {
currentVersion = {
key: latestVersionName,
name: latestVersionName,
tag: config.projectTag,
path: '',
sha: 'abcde'
};
}

return currentVersion;
},

set(key, val) {
return val;
}
})
});

0 comments on commit fea8520

Please sign in to comment.