chore: automated housekeeping...

This commit is contained in:
Pieter Vander Vennet 2025-03-07 21:53:42 +01:00
parent c1a2126b32
commit 4c93f023dd
32 changed files with 1551 additions and 76 deletions

View file

@ -160,8 +160,8 @@ export default class FeatureReviews {
private readonly _testmode: Store<boolean>
public readonly loadingAllowed: UIEventSource<boolean | null>
private readonly _options: Readonly<{
nameKey?: "name" | string;
fallbackName?: string;
nameKey?: "name" | string
fallbackName?: string
uncertaintyRadius?: number
}>
@ -300,15 +300,21 @@ export default class FeatureReviews {
},
state?: SpecialVisualizationState
): FeatureReviews {
const key = feature.properties.id + ";" + (options?.nameKey ?? "") + ";" + (options?.fallbackName ?? "")
const key =
feature.properties.id +
";" +
(options?.nameKey ?? "") +
";" +
(options?.fallbackName ?? "")
const cached = FeatureReviews._featureReviewsCache[key]
if (cached !== undefined) {
return cached
}
const themeIsSensitive = state?.theme?.enableMorePrivacy ?? false
const settings = state?.osmConnection?.getPreference<"always" | "yes" | "ask" | "hidden">(
"reviews-allowed"
) ?? new ImmutableStore("yes");
const settings =
state?.osmConnection?.getPreference<"always" | "yes" | "ask" | "hidden">(
"reviews-allowed"
) ?? new ImmutableStore("yes")
const loadingAllowed = new UIEventSource(false)
settings.addCallbackAndRun((s) => {
if (s === "hidden") {