setProperty function doesn't set an empty array if property doesn't exist
This commit is contained in:
parent
e1611969ce
commit
c5b5326480
@ -42,7 +42,7 @@ Before committing, be sure to install the "Prettier" precommit hook that will re
|
|||||||
In order to enable the "Prettier" precommit hook, at the root of the project, run:
|
In order to enable the "Prettier" precommit hook, at the root of the project, run:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ yarn run install
|
$ yarn install
|
||||||
$ yarn run prepare
|
$ yarn run prepare
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1075,11 +1075,13 @@ ${escapedMessage}
|
|||||||
console.warn('Could not find layer "' + layerName + '" when calling setProperty');
|
console.warn('Could not find layer "' + layerName + '" when calling setProperty');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const property = (layer.properties as ITiledMapLayerProperty[])?.find(
|
if (layer.properties === undefined) {
|
||||||
|
layer.properties = [];
|
||||||
|
}
|
||||||
|
const property = (layer.properties as ITiledMapLayerProperty[]).find(
|
||||||
(property) => property.name === propertyName
|
(property) => property.name === propertyName
|
||||||
);
|
);
|
||||||
if (property === undefined) {
|
if (property === undefined) {
|
||||||
layer.properties = [];
|
|
||||||
layer.properties.push({ name: propertyName, type: typeof propertyValue, value: propertyValue });
|
layer.properties.push({ name: propertyName, type: typeof propertyValue, value: propertyValue });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -286,11 +286,6 @@
|
|||||||
"name":"jitsiTrigger",
|
"name":"jitsiTrigger",
|
||||||
"type":"string",
|
"type":"string",
|
||||||
"value":"onaction"
|
"value":"onaction"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name":"jitsiUrl",
|
|
||||||
"type":"string",
|
|
||||||
"value":"meet.jit.si"
|
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user