Skip to content

Commit

Permalink
fix: update falsy values "0", "false" and "null"
Browse files Browse the repository at this point in the history
only check if value are undefined.
  • Loading branch information
d-koppenhagen committed May 22, 2024
1 parent 56b386d commit b39d0c6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/components/layers/OlLayerGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<script setup lang="ts">
import {
inject,
provide,
onUnmounted,
onMounted,
watch,
onUnmounted,
provide,
shallowRef,
watch,
} from "vue";
import LayerGroup, { type Options } from "ol/layer/Group";
import type Map from "ol/Map";
Expand Down Expand Up @@ -58,7 +58,7 @@ watch(
(newValue) => {
for (const key in newValue) {
const keyInObj = key as keyof typeof newValue;
if (newValue[keyInObj]) {
if (newValue[keyInObj] !== undefined) {
layerGroup.value.set(key, newValue[keyInObj]);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/map/OlOverlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import type { PanIntoViewOptions, Positioning } from "ol/Overlay";
import Overlay, { type Options } from "ol/Overlay";
import {
inject,
ref,
watchEffect,
watch,
onMounted,
onUnmounted,
ref,
shallowRef,
watch,
watchEffect,
} from "vue";
import type Map from "ol/Map";
Expand Down Expand Up @@ -82,7 +82,7 @@ watch(
(newValue) => {
for (const key in newValue) {
const keyInObj = key as keyof typeof newValue;
if (newValue[keyInObj]) {
if (newValue[keyInObj] !== undefined) {
overlay.value.set(key, newValue[keyInObj]);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/composables/useLayer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { inject, onUnmounted, ref, watch, type Ref } from "vue";
import { inject, onUnmounted, ref, type Ref, watch } from "vue";

import type { Map } from "ol";
import type LayerGroup from "ol/layer/Group";
Expand Down Expand Up @@ -26,7 +26,7 @@ export default function useLayerInMapOrLayerGroup(

for (const key in properties) {
const keyInObj = key as keyof typeof properties;
if (properties[keyInObj]) {
if (properties[keyInObj] !== undefined) {
layer.value.set(key, properties[keyInObj]);
}
}
Expand Down

0 comments on commit b39d0c6

Please sign in to comment.