fixed
This commit is contained in:
		@@ -2,7 +2,7 @@ import {Component} from "@angular/core";
 | 
			
		||||
import {Observable, timer} from "rxjs";
 | 
			
		||||
import {map, take} from "rxjs/operators";
 | 
			
		||||
import {Router} from "@angular/router";
 | 
			
		||||
import {SyncService} from "../map/sync.service";
 | 
			
		||||
import {SyncService} from "../../services/sync.service";
 | 
			
		||||
 | 
			
		||||
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,24 +0,0 @@
 | 
			
		||||
import {Injectable} from "@angular/core";
 | 
			
		||||
import {AngularFirestore, AngularFirestoreCollection, DocumentSnapshot} from "@angular/fire/firestore";
 | 
			
		||||
import {map} from "rxjs/operators";
 | 
			
		||||
 | 
			
		||||
@Injectable({
 | 
			
		||||
    providedIn: 'root'
 | 
			
		||||
})
 | 
			
		||||
export class SyncService {
 | 
			
		||||
    private collection: AngularFirestoreCollection;
 | 
			
		||||
 | 
			
		||||
    constructor(private db: AngularFirestore) {
 | 
			
		||||
        this.collection = this.db.collection('Maps');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async exists(mapCode: string) {
 | 
			
		||||
        return (await this.collection.doc(mapCode).ref.get()).exists;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    load(mapCode: string) {
 | 
			
		||||
        return this.collection.doc(mapCode).snapshotChanges().pipe(map((snap: any) => {
 | 
			
		||||
            return Object.assign({}, snap.data, {delete: snap.ref.delete, set: snap.ref.set, update: snap.ref.update});
 | 
			
		||||
        }))
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user