jam-cloud/web/app/assets/javascripts/client_init.js.coffee

30 lines
664 B
CoffeeScript

# one time init stuff for the /client view
$ = jQuery
context = window
context.JK ||= {};
broadcastActions = BroadcastNotificationActions # require('./react-components/actions/BroadcastNotificationActions')
context.JK.ClientInit = class ClientInit
constructor: () ->
@logger = context.JK.logger
@gearUtils = context.JK.GearUtils
init: () =>
if context.gon.isNativeClient
this.nativeClientInit()
setTimeout(this.checkBroadcastNotification, 3000)
checkBroadcastNotification: () =>
if context.JK.userId
broadcastActions.load.triggerPromise()
nativeClientInit: () =>
@gearUtils.bootstrapDefaultPlaybackProfile();