Fixes, surveillance cams v0.1

This commit is contained in:
Pieter Vander Vennet 2020-11-13 23:58:11 +01:00
parent b329bbbdb3
commit ba44024dd9
10 changed files with 137 additions and 65 deletions

View file

@ -42,6 +42,9 @@ export default class DeleteImage extends UIElement {
}
InnerRender(): string {
if(!State.state.featureSwitchUserbadge.data){
return "";
}
const value = this.tags.data[this.key];
if (value === undefined || value === "") {

View file

@ -51,6 +51,10 @@ export class ImageUploadFlow extends UIElement {
}
InnerRender(): string {
if(!State.state.featureSwitchUserbadge.data){
return "";
}
const t = Translations.t.image;
if (State.state.osmConnection.userDetails === undefined) {

View file

@ -9,25 +9,11 @@ import {SubstitutedTranslation} from "../SpecialVisualizations";
export default class TagRenderingAnswer extends UIElement {
private _tags: UIEventSource<any>;
private _configuration: TagRenderingConfig;
private _content: UIElement;
constructor(tags: UIEventSource<any>, configuration: TagRenderingConfig) {
super(tags);
this._tags = tags;
this._configuration = configuration;
const self = this;
tags.addCallbackAndRun(tags => {
if (tags === undefined) {
self._content = undefined
return;
}
const tr = this._configuration.GetRenderValue(tags);
if (tr === undefined) {
self._content = undefined
return
}
self._content = new SubstitutedTranslation(tr, self._tags)
})
}
InnerRender(): string {
@ -36,10 +22,16 @@ export default class TagRenderingAnswer extends UIElement {
return "";
}
}
if(this._content === undefined){
const tags = this._tags.data;
if (tags === undefined) {
return "";
}
return this._content.Render();
const tr = this._configuration.GetRenderValue(tags);
if (tr === undefined) {
return "";
}
return new SubstitutedTranslation(tr, this._tags).Render();
}
}