Added sync freezing while editing symbols
This commit is contained in:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user