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')
|
localStorage?.setItem('travis.auto_signin', 'true')
|
||||||
sessionStorage?.setItem('travis.user', JSON.stringify(user))
|
sessionStorage?.setItem('travis.user', JSON.stringify(user))
|
||||||
@store.load(Travis.User, user)
|
@store.load(Travis.User, user)
|
||||||
user = @store.find(Travis.User, user.id)
|
@store.find(Travis.User, user.id)
|
||||||
transaction = @store.transaction()
|
|
||||||
transaction.add user
|
|
||||||
user
|
|
||||||
|
|
||||||
receiveMessage: (event) ->
|
receiveMessage: (event) ->
|
||||||
if event.origin == @expectedOrigin()
|
if event.origin == @expectedOrigin()
|
||||||
|
|
|
@ -16,6 +16,10 @@ require 'travis/model'
|
||||||
@poll() if @get('isSyncing')
|
@poll() if @get('isSyncing')
|
||||||
@_super()
|
@_super()
|
||||||
|
|
||||||
|
Ember.run.next this, ->
|
||||||
|
transaction = @get('store').transaction()
|
||||||
|
transaction.add this
|
||||||
|
|
||||||
urlGithub: (->
|
urlGithub: (->
|
||||||
"https://github.com/#{@get('login')}"
|
"https://github.com/#{@get('login')}"
|
||||||
).property()
|
).property()
|
||||||
|
@ -26,6 +30,15 @@ require 'travis/model'
|
||||||
transaction = @get('transaction')
|
transaction = @get('transaction')
|
||||||
transaction.commit()
|
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: (->
|
type: (->
|
||||||
'user'
|
'user'
|
||||||
).property()
|
).property()
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user