Skip to content

Commit

Permalink
Merge branch 'hotfix/0.113.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescdavis committed Aug 28, 2017
2 parents 74b9b97 + 980ad45 commit 3afd92e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
33 changes: 19 additions & 14 deletions app/routes/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,26 @@ export default Ember.Route.extend(Analytics, OSFAgnosticAuthRouteMixin, {
theme: Ember.inject.service(),

beforeModel: function () {
// Set the provider ID from the current origin
if (window.isProviderDomain) {
return this.get('store').query(
'preprint-provider',
{
filter: {
domain: `${window.location.origin}/`,
let detectBrandedDomain = () => {
// Set the provider ID from the current origin
if (window.isProviderDomain) {
return this.get('store').query(
'preprint-provider',
{
filter: {
domain: `${window.location.origin}/`,
}
}
}
).then(providers => {
if (providers.length) {
this.set('theme.id', providers.objectAt(0).get('id'));
}
});
}
).then(providers => {
if (providers.length) {
this.set('theme.id', providers.objectAt(0).get('id'));
}
});
}
};
let parentResult = this._super(...arguments);
// Chain on to parent's promise if parent returns a promise.
return parentResult instanceof Promise ? parentResult.then(detectBrandedDomain) : detectBrandedDomain();
},

afterModel: function() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "preprint-service",
"version": "0.113.0",
"version": "0.113.1",
"description": "Center for Open Science Preprint Service",
"private": true,
"directories": {
Expand Down

0 comments on commit 3afd92e

Please sign in to comment.