implemented amplitude metrics (#1141)
This commit is contained in:
parent
1a483cad55
commit
9b37e92a81
26 changed files with 774 additions and 528 deletions
|
@ -1,4 +1,4 @@
|
|||
import { isFile } from './utils';
|
||||
import { arrayToB64, isFile } from './utils';
|
||||
import OwnedFile from './ownedFile';
|
||||
|
||||
class Mem {
|
||||
|
@ -58,6 +58,15 @@ class Storage {
|
|||
return fs;
|
||||
}
|
||||
|
||||
get id() {
|
||||
let id = this.engine.getItem('device_id');
|
||||
if (!id) {
|
||||
id = arrayToB64(crypto.getRandomValues(new Uint8Array(16)));
|
||||
this.engine.setItem('device_id', id);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
get totalDownloads() {
|
||||
return Number(this.engine.getItem('totalDownloads'));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue