Permalink
Browse files

Fixed a syntax error in the facebook publish action, and added checks…

… for already-subscribed in the Mailchimp subscribe action
  • Loading branch information...
1 parent c0d3255 commit 96a79a0cde7c39503d0aad04ee7de639fb113433 Harry Brundage committed Nov 24, 2010
@@ -5,11 +5,10 @@ class PublishStreamAction extends Citrus.FacebookAction
buttonText: "Share"
action: (account, success, failure) ->
- Titanium.Facebook.publishStream(@title, @data, @target, (e) =>
+ Titanium.Facebook.publishStream @title, @data, @target, (e) =>
if e.success
success(e)
else
failure(e)
- )
Citrus.Actions.Facebook.PublishStreamAction = PublishStreamAction

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -23,12 +23,15 @@ class SubscribeAction extends Citrus.MailchimpAction
apikey: @apiKey
email_address: account.email
id: @listId
- merge_vars:
- OPTINIP: Titanium.Platform.address
success: (data, status, xhr) ->
if data.error?
- e("Error subscribing to list!")
- failure(xhr, status, data)
+ if data.error.match(/is already subscribed/)
+ alert(data.error+"!")
+ success({})
+ else
+ er("Error subscribing to list!")
+ er(data, status, xhr)
+ failure(xhr, status, data)
else
d("Success subscribing", data, "Status:", status, "Code", xhr.status, "Response", xhr.responseText)
success(data)

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 96a79a0

Please sign in to comment.