Skip to content

Commit

Permalink
RT
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianovide committed Jun 14, 2021
1 parent 603c487 commit efb1dd4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/App.js
Expand Up @@ -245,6 +245,7 @@ class App extends Component {
};

modifyFeature = (photo) => {
console.debug(`modifying ${JSON.stringify(photo)}`)
this.featuresDict[photo.id] = {
type: "Feature",
geometry: {
Expand All @@ -257,9 +258,13 @@ class App extends Component {
this.delayedSaveGeojson();
};

addFeature = (photo) => this.modifyFeature(photo);
addFeature = (photo) => {
console.debug(`adding -->`)
this.modifyFeature(photo);
}

removeFeature = (photo) => {
console.debug(`removing $${JSON.stringify(photo)}`)
delete this.featuresDict[photo.id];
this.delayedSaveGeojson();
};
Expand Down Expand Up @@ -311,6 +316,7 @@ class App extends Component {
}

async registerPublishedPhotosRT() {
debugger
if (this.unregisterPublishedPhotosRT) {
await this.unregisterPublishedPhotosRT();
}
Expand Down
3 changes: 1 addition & 2 deletions src/features/firebase/dbFirebase.js
Expand Up @@ -59,12 +59,11 @@ function extractPhoto(data, id) {
function publishedPhotosRT(addedFn, modifiedFn, removedFn, errorFn, fromDate) {
const publishedPhotosRef = firestore
.collection("photos")
.orderBy("moderated", "desc")
.where("published", "==", true);
let newPublishedRef;
if (fromDate) {
newPublishedRef = publishedPhotosRef.where(
"moderated",
"updated",
">",
firebase.firestore.Timestamp.fromDate(fromDate)
);
Expand Down

0 comments on commit efb1dd4

Please sign in to comment.