forked from MapComplete/MapComplete
Merge master
This commit is contained in:
commit
8d08ebf416
34 changed files with 6821 additions and 262 deletions
|
|
@ -177,7 +177,7 @@ export default class FeatureReviews {
|
|||
}>,
|
||||
testmode?: Store<boolean>,
|
||||
loadingAllowed?: UIEventSource<boolean | null>,
|
||||
reportError?: (msg: string, extra: string) => Promise<void>
|
||||
reportError?: (msg: string, extra: string) => Promise<void>
|
||||
) {
|
||||
this.loadingAllowed = loadingAllowed
|
||||
this._reportError = reportError
|
||||
|
|
@ -294,7 +294,7 @@ export default class FeatureReviews {
|
|||
tagsSource: UIEventSource<Record<string, string>>,
|
||||
mangroveIdentity: MangroveIdentity,
|
||||
options: { nameKey: string; fallbackName: string },
|
||||
state?: SpecialVisualizationState,
|
||||
state?: SpecialVisualizationState
|
||||
): FeatureReviews {
|
||||
const key =
|
||||
feature.properties.id +
|
||||
|
|
@ -362,10 +362,13 @@ export default class FeatureReviews {
|
|||
const jwt = await MangroveReviews.signReview(keypair, r)
|
||||
const kid = await MangroveReviews.publicToPem(keypair.publicKey)
|
||||
if (!this._testmode.data) {
|
||||
try{
|
||||
try {
|
||||
await MangroveReviews.submitReview(jwt)
|
||||
}catch (e) {
|
||||
await this._reportError(e, "Could not save a review. The text is:"+review.rating+", "+review.opinion)
|
||||
} catch (e) {
|
||||
await this._reportError(
|
||||
e,
|
||||
"Could not save a review. The text is:" + review.rating + ", " + review.opinion
|
||||
)
|
||||
throw e
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue