Saving event only triggered for map, not location

This commit is contained in:
Zakary Timson 2019-09-02 20:59:23 -04:00
parent 7633a41185
commit 4da96b3b45

View File

@ -144,7 +144,6 @@ export class SyncService {
} }
save(map=true, location=true) { save(map=true, location=true) {
this.status.next('saving');
let promises = []; let promises = [];
if(location && this.locationDoc && this.locationChanged) { if(location && this.locationDoc && this.locationChanged) {
@ -152,6 +151,7 @@ export class SyncService {
} }
if(map && this.mapDoc && this.mapChanged) { if(map && this.mapDoc && this.mapChanged) {
this.status.next('saving');
let map = this.mapData.value; let map = this.mapData.value;
Object.values(map).filter(val => Array.isArray(val)).forEach(val => val.filter(s => s.new).forEach(s => delete s.new)); Object.values(map).filter(val => Array.isArray(val)).forEach(val => val.filter(s => s.new).forEach(s => delete s.new));
delete map.locations; delete map.locations;