Added sync freezing while editing symbols
This commit is contained in:
parent
12c04c366d
commit
ae767f6a5d
@ -110,7 +110,7 @@ export class SyncService {
|
||||
}).snapshotChanges(), this.freeze)
|
||||
.pipe(map(data => {
|
||||
let oldMap = this.mapData.value;
|
||||
if(data[2]) return oldMap;
|
||||
if(data[2]) return;
|
||||
let newMap = data[0] || {};
|
||||
let mergedMap = this.mergeMaps(newMap, oldMap);
|
||||
|
||||
@ -121,6 +121,7 @@ export class SyncService {
|
||||
|
||||
return mergedMap;
|
||||
})).subscribe((mapData: MapData) => {
|
||||
if(!mapData) return;
|
||||
this.mapData.next(mapData);
|
||||
this.status.next(null);
|
||||
if(this.saveInterval) clearInterval(this.saveInterval);
|
||||
|
@ -110,7 +110,9 @@ export class MapComponent implements OnDestroy, OnInit {
|
||||
this.map.click.pipe(filter(e => !!e)).subscribe(e => {
|
||||
if(this.sub == null && e.symbol) {
|
||||
if(e.symbol.noClick) return;
|
||||
this.syncService.freeze.next(true);
|
||||
this.sub = this.bottomSheet.open(EditSymbolComponent, {data: e, disableClose: true, hasBackdrop: false}).afterDismissed().pipe(finalize(() => this.sub = null)).subscribe(symbol => {
|
||||
this.syncService.freeze.next(false);
|
||||
this.syncService.delete(e.symbol);
|
||||
if(e.item instanceof L.Circle) {
|
||||
this.syncService.addCircle(symbol);
|
||||
|
Loading…
Reference in New Issue
Block a user