Always delete

This commit is contained in:
Zakary Timson 2019-09-02 14:12:05 -04:00
parent 86163d8fd6
commit 5f1861240c

View File

@ -135,6 +135,9 @@ export class SyncService {
}
async unload() {
// Hack to delete doc on page close
navigator.sendBeacon(`https://us-central1-mapalliance-ab38a.cloudfunctions.net/closeSession/?mapCode=${this.mapCode}&username=${this.username}`);
this.save();
if(this.saveInterval) clearInterval(this.saveInterval);
@ -152,7 +155,6 @@ export class SyncService {
this.location = null;
this.locationChanged = false;
this.locationDoc = null;
navigator.sendBeacon(`https://us-central1-mapalliance-ab38a.cloudfunctions.net/closeSession/?mapCode=${this.mapCode}&username=${this.username}`);
}
this.mapCode = null;