Skip to content
Snippets Groups Projects
Commit 7bdde4de authored by Robin Leber's avatar Robin Leber
Browse files

fix: add custom code bug

parent 870f9a39
No related branches found
No related tags found
No related merge requests found
...@@ -55,12 +55,14 @@ const addCustomCodeToJson = async (newElement) => { ...@@ -55,12 +55,14 @@ const addCustomCodeToJson = async (newElement) => {
const existingFilter = customCodes.find( const existingFilter = customCodes.find(
(element) => element.id === newElement.id (element) => element.id === newElement.id
); );
if (existingFilter) { if (existingFilter && existingFilter.isDeployed) {
await killDockerContainer(newElement.id); await killDockerContainer(newElement.id);
await removeDockerContainer(newElement.id); await removeDockerContainer(newElement.id);
await removeDockerImage(newElement.id); await removeDockerImage(newElement.id);
existingFilter.code = newElement.code; existingFilter.code = newElement.code;
existingFilter.isDeployed = false; existingFilter.isDeployed = false;
} else if (existingFilter && !existingFilter.isDeployed) {
existingFilter.code = newElement.code;
} else { } else {
customCodes.push(newElement); customCodes.push(newElement);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment