Skip to content

Commit e9fae86

Browse files
committed
fix: customer id over timestamp
1 parent 90fef0b commit e9fae86

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/pages/vision/vision.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ export class VisionPage {
4242
// Show loader
4343
this.loading.present();
4444

45-
const timestamp = new Date().getTime().toString();
46-
const path = `${timestamp}.jpg`;
45+
// const timestamp = new Date().getTime().toString();
46+
const docId = this.afs.createId();
47+
48+
const path = `${docId}.jpg`;
4749

4850
// Make a reference to the future location of the firestore document
49-
const photoRef = this.afs.collection('photos').doc(timestamp)
51+
const photoRef = this.afs.collection('photos').doc(docId)
5052

5153
// Firestore observable
5254
this.result$ = photoRef.valueChanges()

0 commit comments

Comments
 (0)