Conversation
| watch(selectedFeature, value => { | ||
| if (value && getFeatureType(value) === FeatureType.Flash) { | ||
| selectedFeature.value = (getFeatureData(value) as FlashFeatureData).refFeature | ||
| } | ||
| }, { flush: 'sync' }) |
There was a problem hiding this comment.
@linusbbb In my opinion we should not use a watcher on a variable and the watcher is changing this variable again. This could potentially lead to infinite loops in the future.
The better option would be to do this check inside the function selectedItem.
|
|
||
| watch(features, () => { | ||
| if (features.value.length === 1) { | ||
| selectedFeature.value = features.value[0] |
There was a problem hiding this comment.
| selectedFeature.value = features.value[0] | |
| selectedItem(features.value[0]) |
| if (features.value.length === 1) { | ||
| selectedFeature.value = features.value[0] | ||
| } | ||
| }) |
There was a problem hiding this comment.
@linusbbb If you mount the component immediately with only one feature this watcher would not have been executed. That's why we need
| }) | |
| }, { immediate: true }) |
| selectedFeature.value = null | ||
| } | ||
|
|
||
| function selectedItem (feature: Feature<Geometry>) { |
There was a problem hiding this comment.
@linusbbb I would recommend to rename this function to
| function selectedItem (feature: Feature<Geometry>) { | |
| function selectFeature (feature: Feature<Geometry>) { |
| this.mastList = this.svgService.getSvgElementInGroup(SVGMast.ShortMount) | ||
| } | ||
| function getZusatzSignal (): ZusatzSignal[] { | ||
| return (svgService.getSvgElementInGroup(AndereSignalGroup.ZusatzSignale) ?? []) as ZusatzSignal[] |
There was a problem hiding this comment.
@linusbbb Why do we need the type cast here? We also don't have it in getShortMast
| return (svgService.getSvgElementInGroup(AndereSignalGroup.ZusatzSignale) ?? []) as ZusatzSignal[] | |
| return svgService.getSvgElementInGroup(AndereSignalGroup.ZusatzSignale) ?? [] |
| const compareProps = [ | ||
| { | ||
| prop: getpropertypeName(defaultStationObj(), x => x.label), | ||
| prop: getpropertypeName(defaultStationObj(), x => x.label!), |
There was a problem hiding this comment.
@linusbbb Is this really safe? In my opinion we should use a fallback e.g. like
| prop: getpropertypeName(defaultStationObj(), x => x.label!), | |
| prop: getpropertypeName(defaultStationObj(), x => x.label ?? ''), |
There was a problem hiding this comment.
@linusbbb Here we should fix the length of the "Export PPM" input element
There was a problem hiding this comment.
@linusbbb Here we should also fix the length of the select element
|
@linusbbb And please resolve the merge conflicts and the failing typecheck |
No description provided.