Skip to content

Commit

Permalink
Merged in fix_saving_new_locations (pull request #41)
Browse files Browse the repository at this point in the history
Fix saving new locations

Approved-by: Grzegorz Wiecheć <gregorwiechec@gmail.com>
  • Loading branch information
barteksekula authored and gregwiechec committed Apr 14, 2019
2 parents fa5cd0f + 8e0e085 commit 105a246
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ui/reviewLocationsCollection.tsx
Expand Up @@ -31,7 +31,7 @@ export default class ReviewLocationsCollection extends React.Component<ReviewLoc
<div>
{filter.showPoints &&
locations.map(location =>
<ReviewLocationComponent key={location.id} location={location} showDialog={(e) => this.onLocationClick(e, location)} />
<ReviewLocationComponent key={location.id || "unsaved"} location={location} showDialog={(e) => this.onLocationClick(e, location)} />
)}
</div>)
};
Expand Down
3 changes: 2 additions & 1 deletion src/ui/reviewStore.tsx
Expand Up @@ -262,7 +262,7 @@ class ReviewComponentStore implements IReviewComponentStore {
positionX: reviewLocation.positionX,
positionY: reviewLocation.positionY,
priority: reviewLocation.priority,
comments: reviewLocation.comments.map((x: any) => {
comments: reviewLocation.comments.map((x: any) => {
return {
author: x.author,
date: x.date,
Expand All @@ -278,6 +278,7 @@ class ReviewComponentStore implements IReviewComponentStore {
};
this._advancedReviewService.add(reviewLocation.id, data).then((result) => {
if (reviewLocation.id !== result.id) {
reviewLocation.id = result.id;
this.reviewLocations.push(reviewLocation);
}
resolve(reviewLocation);
Expand Down

0 comments on commit 105a246

Please sign in to comment.