Skip to content

Commit

Permalink
Merge pull request #75 from zendesk/stef/settings_getter
Browse files Browse the repository at this point in the history
Getter for settings
  • Loading branch information
svizzari authored Oct 9, 2017
2 parents 42056a9 + 4c42027 commit 6303ff1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/javascripts/base_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,17 @@ BaseApp.extend = function(appPrototype) {

App.prototype = _.extend({}, BaseApp.prototype, appPrototype);

// settings is an alias provided so that any apps that attempt
// direct access of the object underlying the setting API. See
// https://developer.zendesk.com/apps/docs/agent/data#setting
// we define this property after extending BaseApp so that the
// accessor won't be called before the app is instantiated
Object.defineProperty(App.prototype, "settings", {
get() {
return this._metadata.settings;
}
});

return App;
};

Expand Down

0 comments on commit 6303ff1

Please sign in to comment.