Skip to content

Commit

Permalink
Update application.js
Browse files Browse the repository at this point in the history
  • Loading branch information
shopapps committed Sep 17, 2014
1 parent 937ce37 commit 2bc7511
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions example/app/adapters/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
* [email protected]
*
* NOTES: This is a ember-cli file used to create a socket adapter
to use, change the line in the init: function where it says window.Myapp.__container__
so that Myapp is the name of your App
*/
import Ember from 'ember';
import DS from "ember-data";
Expand All @@ -16,11 +14,8 @@ export default DS.Adapter.extend({
needs: ['application'],
init: function() {
console.log("STARTING SOCKET ADAPTER");
/*
* Put your module name here (relace Myapp).
* todo: find a better method of getting the socket reference...
*/
this.socket = window.Myapp.__container__.lookup('socket:Main');

this.socket = this.container.lookup('socket:main').socket;
this._super();
},

Expand All @@ -33,7 +28,7 @@ export default DS.Adapter.extend({
*/
return new Ember.RSVP.Promise(function (resolve, reject) {
try {
if(!adapter.socket.socket.connected)
if(!adapter.socket.connected)
{
console.log('[Adapter] App.Socket is not yet connected');
reject({ message : 'App.Socket is not yet connected'});
Expand Down

0 comments on commit 2bc7511

Please sign in to comment.