Fix first run telemetry bug
This commit is contained in:
@@ -14,14 +14,16 @@ const config = require('../../config')
|
|||||||
let telemetry
|
let telemetry
|
||||||
|
|
||||||
function init (state) {
|
function init (state) {
|
||||||
if (!state.saved.telemetry) {
|
telemetry = state.saved.telemetry
|
||||||
|
|
||||||
|
// First app run
|
||||||
|
if (!telemetry) {
|
||||||
const crypto = require('crypto')
|
const crypto = require('crypto')
|
||||||
state.saved.telemetry = {
|
telemetry = state.saved.telemetry = {
|
||||||
userID: crypto.randomBytes(32).toString('hex') // 256-bit random ID
|
userID: crypto.randomBytes(32).toString('hex') // 256-bit random ID
|
||||||
}
|
}
|
||||||
reset()
|
reset()
|
||||||
}
|
}
|
||||||
telemetry = state.saved.telemetry
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function send (state) {
|
function send (state) {
|
||||||
|
|||||||
Reference in New Issue
Block a user