mirror of
https://github.com/lxsang/antos-frontend.git
synced 2024-11-19 10:58:20 +01:00
fix sign in problem
This commit is contained in:
parent
90f7e1d166
commit
7baa808b55
@ -14,8 +14,14 @@ class GoogleDriveHandler extends this.OS.API.VFS.BaseFileHandler
|
||||
oninit: (f) ->
|
||||
me = @
|
||||
return unless @setting
|
||||
fn = (r) ->
|
||||
return f() if r
|
||||
# perform the login
|
||||
G_CACHE = {"gdv:///":"root"}
|
||||
gapi.auth2.getAuthInstance().signIn()
|
||||
|
||||
if _API.libready @setting.apilink
|
||||
f()
|
||||
fn(gapi.auth2.getAuthInstance().isSignedIn.get())
|
||||
else
|
||||
_API.require @setting.apilink, () ->
|
||||
gapi.load "client:auth2", () ->
|
||||
@ -26,15 +32,11 @@ class GoogleDriveHandler extends this.OS.API.VFS.BaseFileHandler
|
||||
scope: me.setting.SCOPES
|
||||
}
|
||||
.then () ->
|
||||
fn = (r) ->
|
||||
return f() if r
|
||||
# perform the login
|
||||
G_CACHE = {"gdv:///":"root"}
|
||||
gapi.auth2.getAuthInstance().signIn()
|
||||
|
||||
gapi.auth2.getAuthInstance().isSignedIn.listen (r) ->
|
||||
fn(r)
|
||||
fn(gapi.auth2.getAuthInstance().isSignedIn.get())
|
||||
, (err) ->
|
||||
_courrier.oserror "VFS cannot init GAPI", (_API.throwe "OS.VFS"), err
|
||||
|
||||
meta: (f) ->
|
||||
me = @
|
||||
|
Loading…
Reference in New Issue
Block a user