console.log("Got keypress", e)}>
|
-
|
+
|
{#each $favourites as feature (feature.properties.id)}
diff --git a/src/UI/Reviews/ReviewForm.svelte b/src/UI/Reviews/ReviewForm.svelte
index d6f06e40a..f37722d89 100644
--- a/src/UI/Reviews/ReviewForm.svelte
+++ b/src/UI/Reviews/ReviewForm.svelte
@@ -35,9 +35,9 @@
let _state: "ask" | "saving" | "done" = "ask"
- const connection = state.osmConnection
+ let connection = state.osmConnection
- const hasError: Store
= opinion.mapD(op => {
+ let hasError: Store = opinion.mapD(op => {
const tooLong = op.length > FeatureReviews.REVIEW_OPINION_MAX_LENGTH
if (tooLong) {
return "too_long"
@@ -45,6 +45,8 @@
return undefined
})
+ let uploadFailed: string = undefined
+
async function save() {
if (hasError.data) {
return
@@ -63,13 +65,24 @@
console.log("Testing - not actually saving review", review)
await Utils.waitFor(1000)
} else {
- await reviews.createReview(review)
+ try {
+
+ await reviews.createReview(review)
+ } catch (e) {
+ console.error("Could not create review due to", e)
+ uploadFailed = "" + e
+ }
}
_state = "done"
}
-
-{#if _state === "done"}
+{#if uploadFailed}
+