<commit_before>window.$ = window.jQuery = require 'jquery'
audio = require 'sharp11-web-audio'
React = require 'react'
ReactDOM = require 'react-dom'
MarkatoPage = require './MarkatoPage'
Loading = require './Loading'
firebase = require 'firebase/app'
storageModule = require './storage'

require 'firebase/auth'
require 'firebase/database'
require 'bootstrap/dist/js/bootstrap'

firebase.initializeApp
  apiKey: "<KEY>",
  authDomain: "markato-42764.firebaseapp.com",
  databaseURL: "https://markato-42764.firebaseio.com",
  storageBucket: "markato-42764.appspot.com"

ReactDOM.render <Loading />, document.getElementById 'body'

audio.init (err, fns) ->
  if err then alert err
  {play} = fns

  firebase.auth().getRedirectResult().then (result) =>
    user = result.user
    storage = storageModule.init(firebase, user)
    storage.getUserBucket (userBucket) =>
      ReactDOM.render(
        <MarkatoPage play={play}
                     currentUser={user}
                     userBucket={userBucket}
                     setUserBucketKey={storage.setUserBucketKey} />,
        document.getElementById 'body'
      )
<commit_msg>Fixed auth / loading for real this time<commit_after>window.$ = window.jQuery = require 'jquery'
audio = require 'sharp11-web-audio'
React = require 'react'
ReactDOM = require 'react-dom'
MarkatoPage = require './MarkatoPage'
Loading = require './Loading'
firebase = require 'firebase/app'
storageModule = require './storage'

require 'firebase/auth'
require 'firebase/database'
require 'bootstrap/dist/js/bootstrap'

firebase.initializeApp
  apiKey: "<KEY>",
  authDomain: "markato-42764.firebaseapp.com",
  databaseURL: "https://markato-42764.firebaseio.com",
  storageBucket: "markato-42764.appspot.com"

ReactDOM.render <Loading />, document.getElementById 'body'

audio.init (err, fns) ->
  if err then alert err
  {play} = fns

  firebase.auth().getRedirectResult().then =>
    user = firebase.auth().currentUser
    storage = storageModule.init(firebase, user)
    storage.getUserBucket (userBucket) =>
      ReactDOM.render(
        <MarkatoPage play={play}
                     currentUser={user}
                     userBucket={userBucket}
                     setUserBucketKey={storage.setUserBucketKey} />,
        document.getElementById 'body'
      )

{'fraction_non_alphanumeric': 0.12690134724033028, 'fraction_numerical': 0.01477618426770969, 'mean_word_length': 3.4354527938342967, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4117227', 'n_tokens_mistral': 709, 'n_tokens_neox': 686, 'n_words': 147}