Don't try to delete flash if there is no data from server
This commit is contained in:
parent
9bac8ecba1
commit
65eb4e15fb
|
@ -34,13 +34,13 @@ Travis.ajax = Em.Object.create
|
||||||
success = options.success || (->)
|
success = options.success || (->)
|
||||||
options.success = (data) =>
|
options.success = (data) =>
|
||||||
Travis.app.router.flashController.loadFlashes(data.flash) if Travis.app?.router && data.flash
|
Travis.app.router.flashController.loadFlashes(data.flash) if Travis.app?.router && data.flash
|
||||||
delete data.flash
|
delete data.flash if data?
|
||||||
success.apply(this, arguments)
|
success.apply(this, arguments)
|
||||||
|
|
||||||
error = options.error || (->)
|
error = options.error || (->)
|
||||||
options.error = (data) =>
|
options.error = (data) =>
|
||||||
Travis.app.router.flashController.pushObject(data.flash) if data.flash
|
Travis.app.router.flashController.pushObject(data.flash) if data.flash
|
||||||
delete data.flash
|
delete data.flash if data?
|
||||||
error.apply(this, arguments)
|
error.apply(this, arguments)
|
||||||
|
|
||||||
$.ajax($.extend(options, Travis.ajax.DEFAULT_OPTIONS))
|
$.ajax($.extend(options, Travis.ajax.DEFAULT_OPTIONS))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user