@@ -41,8 +41,8 @@ <h2>Initiate</h2>
41
41
yahoo : CLIENT_IDS_ALL . yahoo
42
42
}
43
43
, {
44
- redirect_uri :'../redirect.html' ,
45
- oauth_proxy : OAUTH_PROXY_URL ,
44
+ redirect_uri :'../redirect.html' ,
45
+ oauth_proxy : OAUTH_PROXY_URL ,
46
46
scope :"friends"
47
47
}
48
48
) ;
@@ -58,14 +58,10 @@ <h2>Build Button events</h2>
58
58
btn_more . style . display = 'none' ;
59
59
60
60
// login
61
- hello . login ( network , { scope :'friends' } , function ( auth ) {
62
- if ( ! auth || auth . error ) {
63
- console . log ( "Signin aborted" ) ;
64
- return ;
65
- }
61
+ hello ( network ) . login ( { scope :'friends' } ) . then ( function ( auth ) {
66
62
// Get the friends
67
63
// using path, me/friends or me/contacts
68
- hello ( network ) . api ( path , { limit :10 } , function responseHandler ( r ) {
64
+ hello ( network ) . api ( path , { limit :10 } ) . then ( function responseHandler ( r ) {
69
65
for ( var i = 0 ; i < r . data . length ; i ++ ) {
70
66
var o = r . data [ i ] ;
71
67
var li = document . createElement ( 'li' ) ;
@@ -80,9 +76,14 @@ <h2>Build Button events</h2>
80
76
btn_more . innerHTML = "Next from " + network ;
81
77
btn_more . style . display = 'block' ;
82
78
} ) ;
79
+ } , function ( ) {
80
+ if ( ! auth || auth . error ) {
81
+ console . log ( "Signin aborted" ) ;
82
+ return ;
83
+ }
83
84
} ) ;
84
85
}
85
86
</ script >
86
87
87
88
</ body >
88
- </ html >
89
+ </ html >
0 commit comments