codersgrave / Facebook-Friend-Selector

This repo is no longer maintained. Feel free to fork and update!
http://facebook-friend-selector.codersgrave.com
64 stars 22 forks source link

Callback called even if user cancel #19

Open jeremypetrequin opened 10 years ago

jeremypetrequin commented 10 years ago

Hello,

Line 77 the callback : fsOptions.onSubmit(selected_friends); is called even if the user canceled his share in the FB.ui('apprequest') popin ,

the workaround is to check if there is no error_code in response object :

if(!response.error_code) fsOptions.onSubmit(selected_friends);