Merge master

This commit is contained in:
Pieter Vander Vennet 2025-07-10 17:04:24 +02:00
commit 8d08ebf416
34 changed files with 6821 additions and 262 deletions

View file

@ -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 {