()
| 1853 | } |
| 1854 | |
| 1855 | export function getOrCreateUserID(): string { |
| 1856 | const config = getGlobalConfig() |
| 1857 | if (config.userID) { |
| 1858 | return config.userID |
| 1859 | } |
| 1860 | |
| 1861 | const userID = randomBytes(32).toString('hex') |
| 1862 | saveGlobalConfig(current => ({ ...current, userID })) |
| 1863 | return userID |
| 1864 | } |
| 1865 | |
| 1866 | export function recordFirstStartTime(): void { |
| 1867 | const config = getGlobalConfig() |
no test coverage detected