Skip to content

Commit

Permalink
Fixes FirebaseExtended#396. Use updated ember lookup syntax.
Browse files Browse the repository at this point in the history
Updated deprecated `container.lookup` calls to make use of the favoured
`getOwner()` function. Users of Ember 2.3 and above will no longer see
deprecation warnings about this.
  • Loading branch information
dunnkers committed Jul 4, 2016
1 parent 3dc1b08 commit 73c501e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion addon/services/firebase-app.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import firebase from 'firebase';
import Ember from 'ember';

const { getOwner } = Ember;

export const DEFAULT_NAME = '[EmberFire default app]';

export default {
create(application) {
const config = application.container.lookupFactory('config:environment');
const config = getOwner(application)._lookupFactory('config:environment');
if (!config || typeof config.firebase !== 'object') {
throw new Error('Please set the `firebase` property in your environment config.');
}
Expand Down
5 changes: 4 additions & 1 deletion addon/services/firebase.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import firebase from 'firebase';
import Ember from 'ember';

const { getOwner } = Ember;

export const DEFAULT_NAME = '[EmberFire default app]';

export default {
create(application) {
const config = application.container.lookupFactory('config:environment');
const config = getOwner(application)._lookupFactory('config:environment');
if (!config || typeof config.firebase !== 'object') {
throw new Error('Please set the `firebase` property in your environment config.');
}
Expand Down
3 changes: 2 additions & 1 deletion addon/torii-providers/firebase.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Ember from 'ember';
import Waitable from '../mixins/waitable';

const { getOwner } = Ember;

export default Ember.Object.extend(Waitable, {
firebaseApp: Ember.inject.service(),
Expand Down Expand Up @@ -35,7 +36,7 @@ export default Ember.Object.extend(Waitable, {

// oauth providers e.g. 'twitter'
default:
const ProviderClass = this.container.lookupFactory(`firebase-auth-provider:${providerId}`);
const ProviderClass = getOwner(this).lookup(`firebase-auth-provider:${providerId}`);
if (!ProviderClass) {
return this.waitFor_(reject(new Error('Unknown provider')));
}
Expand Down

2 comments on commit 73c501e

@riemannzeta
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked for me! Thanks.

@alextrastero
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed warning, thanks.

Please sign in to comment.