>
> At the end of the day however this
> is a shindig issue, not a rave issue to solve.
I see that. Maybe there should be a separate trigger that fires after all
the other shindig triggers are done.
> > We've fixed this by explicitly checking for the existence of
> > osapi.people.getViewer, and delaying our gadget's Javascript until the
> > function exists.
>
> Can you post how you went about doing this so other people can use it as
> well?
>
In our project we write Coffeescript, and this code waits for the getViewer
method to exist:
waitForOsapi: (callback) ->
@interval = setInterval =>
if osapi and osapi.people and osapi.people.getViewer
clearInterval(@interval)
callback()
, 25
Which is used as such:
@waitForOsapi =>
console.log "done!"
@doStuff()
--
Roel