Need to add record to the new transaction after saving it
This commit is contained in:
parent
82107bd1f3
commit
b9179e3439
|
@ -57,10 +57,7 @@
|
|||
localStorage?.setItem('travis.auto_signin', 'true')
|
||||
sessionStorage?.setItem('travis.user', JSON.stringify(user))
|
||||
@store.load(Travis.User, user)
|
||||
user = @store.find(Travis.User, user.id)
|
||||
transaction = @store.transaction()
|
||||
transaction.add user
|
||||
user
|
||||
@store.find(Travis.User, user.id)
|
||||
|
||||
receiveMessage: (event) ->
|
||||
if event.origin == @expectedOrigin()
|
||||
|
|
|
@ -16,6 +16,10 @@ require 'travis/model'
|
|||
@poll() if @get('isSyncing')
|
||||
@_super()
|
||||
|
||||
Ember.run.next this, ->
|
||||
transaction = @get('store').transaction()
|
||||
transaction.add this
|
||||
|
||||
urlGithub: (->
|
||||
"https://github.com/#{@get('login')}"
|
||||
).property()
|
||||
|
@ -26,6 +30,15 @@ require 'travis/model'
|
|||
transaction = @get('transaction')
|
||||
transaction.commit()
|
||||
|
||||
self = this
|
||||
observer = ->
|
||||
unless self.get('isSaving')
|
||||
self.removeObserver 'isSaving', observer
|
||||
transaction = self.get('store').transaction()
|
||||
transaction.add self
|
||||
|
||||
@addObserver 'isSaving', observer
|
||||
|
||||
type: (->
|
||||
'user'
|
||||
).property()
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user