🔧 (frontend): Remove NATIVE_CATEGORIES constant and simplify logic for checking template code value in GenericNode component
This commit is contained in:
parent
6e9b5661c8
commit
1f57845993
1 changed files with 2 additions and 7 deletions
|
|
@ -10,7 +10,6 @@ import Loading from "../../components/ui/loading";
|
||||||
import { Textarea } from "../../components/ui/textarea";
|
import { Textarea } from "../../components/ui/textarea";
|
||||||
import Xmark from "../../components/ui/xmark";
|
import Xmark from "../../components/ui/xmark";
|
||||||
import {
|
import {
|
||||||
NATIVE_CATEGORIES,
|
|
||||||
RUN_TIMESTAMP_PREFIX,
|
RUN_TIMESTAMP_PREFIX,
|
||||||
STATUS_BUILD,
|
STATUS_BUILD,
|
||||||
STATUS_BUILDING,
|
STATUS_BUILDING,
|
||||||
|
|
@ -77,18 +76,14 @@ export default function GenericNode({
|
||||||
// This one should run only once
|
// This one should run only once
|
||||||
// first check if data.type in NATIVE_CATEGORIES
|
// first check if data.type in NATIVE_CATEGORIES
|
||||||
// if not return
|
// if not return
|
||||||
if (
|
if (!data.node?.template?.code?.value) return;
|
||||||
!NATIVE_CATEGORIES.includes(types[data.type]) ||
|
|
||||||
!data.node?.template?.code?.value
|
|
||||||
)
|
|
||||||
return;
|
|
||||||
const thisNodeTemplate = templates[data.type].template;
|
const thisNodeTemplate = templates[data.type].template;
|
||||||
// if the template does not have a code key
|
// if the template does not have a code key
|
||||||
// return
|
// return
|
||||||
if (!thisNodeTemplate.code) return;
|
if (!thisNodeTemplate.code) return;
|
||||||
const currentCode = thisNodeTemplate.code?.value;
|
const currentCode = thisNodeTemplate.code?.value;
|
||||||
const thisNodesCode = data.node!.template?.code?.value;
|
const thisNodesCode = data.node!.template?.code?.value;
|
||||||
const componentsToIgnore = ["Custom Component", "Prompt"];
|
const componentsToIgnore = ["Custom Component"];
|
||||||
if (
|
if (
|
||||||
currentCode !== thisNodesCode &&
|
currentCode !== thisNodesCode &&
|
||||||
!componentsToIgnore.includes(data.node!.display_name)
|
!componentsToIgnore.includes(data.node!.display_name)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue