Improved error handling.
This commit is contained in:
parent
dff4a03208
commit
dc263fb92a
2 changed files with 29 additions and 17 deletions
|
@ -38,10 +38,15 @@ class Index extends App.ControllerContent
|
|||
channel = App.Channel.find(channel_id)
|
||||
if channel && channel.options && channel.options.sync
|
||||
displayName = '-'
|
||||
if channel.options.sync.wall.group_id
|
||||
if channel.options.sync.wall && channel.options.sync.wall.group_id
|
||||
group = App.Group.find(channel.options.sync.wall.group_id)
|
||||
displayName = group.displayName()
|
||||
if !channel.options.sync
|
||||
channel.options.sync = {}
|
||||
if !channel.options.sync.wall
|
||||
channel.options.sync.wall = {}
|
||||
channel.options.sync.wall.groupName = displayName
|
||||
if channel.options && channel.options.pages
|
||||
for page in channel.options.pages
|
||||
displayName = '-'
|
||||
for page_id, pageParams of channel.options.sync.pages
|
||||
|
@ -114,6 +119,9 @@ class Index extends App.ControllerContent
|
|||
e.preventDefault()
|
||||
id = $(e.target).closest('.action').data('id')
|
||||
channel = App.Channel.find(id)
|
||||
if !channel
|
||||
@navigate '#channels/facebook'
|
||||
return
|
||||
if !channel.options.sync
|
||||
channel.options.sync = {}
|
||||
if !channel.options.sync.wall
|
||||
|
@ -136,6 +144,7 @@ class Index extends App.ControllerContent
|
|||
el.html(selection)
|
||||
|
||||
groupSelection(channel.options.sync.wall.group_id, content.find('.js-wall .js-groups'), 'wall')
|
||||
if channel.options.pages
|
||||
for page in channel.options.pages
|
||||
pageConfigured = false
|
||||
for page_id, pageParams of channel.options.sync.pages
|
||||
|
|
|
@ -119,6 +119,9 @@ class Index extends App.ControllerContent
|
|||
e.preventDefault()
|
||||
id = $(e.target).closest('.action').data('id')
|
||||
channel = App.Channel.find(id)
|
||||
if !channel
|
||||
@navigate '#channels/twitter'
|
||||
return
|
||||
content = $( App.view('twitter/account_edit')(channel: channel) )
|
||||
|
||||
createGroupSelection = (selected_id, prefix) ->
|
||||
|
|
Loading…
Reference in a new issue