diff --git a/lib/javascripts/base_app.js b/lib/javascripts/base_app.js index 54b7809..8338c5e 100644 --- a/lib/javascripts/base_app.js +++ b/lib/javascripts/base_app.js @@ -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; };