()
| 34 | } |
| 35 | |
| 36 | function authenticateToFirebase() { |
| 37 | return new Promise((resolve, reject) => { |
| 38 | const xhr = $.getJSON('/auth'); |
| 39 | xhr.then((data) => { |
| 40 | const ref = new window.Firebase(config.FIREBASE_URL); |
| 41 | // eslint-disable-next-line no-param-reassign |
| 42 | application.ref = ref; |
| 43 | // eslint-disable-next-line no-param-reassign |
| 44 | application.userId = data.id; |
| 45 | // eslint-disable-next-line no-param-reassign |
| 46 | application.publicIp = data.public_ip; |
| 47 | |
| 48 | ref.authWithCustomToken(data.token, (error) => { |
| 49 | if (error) { |
| 50 | reject(error); |
| 51 | } else { |
| 52 | resolve(); |
| 53 | } |
| 54 | }); |
| 55 | }); |
| 56 | }); |
| 57 | } |
| 58 | |
| 59 | // TODO: move it to a separate initializer |
| 60 | function trackSizeOfReceivedFiles() { |
nothing calls this directly
no outgoing calls
no test coverage detected