Fixed success alert not appearing at front, and removed alert displayed at playground
This commit is contained in:
parent
14a7e2835e
commit
9bafb1f5dd
4 changed files with 29 additions and 28 deletions
|
|
@ -222,12 +222,19 @@ export default function App() {
|
|||
id={alert.id}
|
||||
removeAlert={removeAlert}
|
||||
/>
|
||||
) : alert.type === "notice" ? (
|
||||
<NoticeAlert
|
||||
key={alert.id}
|
||||
title={alert.title}
|
||||
link={alert.link}
|
||||
id={alert.id}
|
||||
removeAlert={removeAlert}
|
||||
/>
|
||||
) : (
|
||||
alert.type === "notice" && (
|
||||
<NoticeAlert
|
||||
alert.type === "success" && (
|
||||
<SuccessAlert
|
||||
key={alert.id}
|
||||
title={alert.title}
|
||||
link={alert.link}
|
||||
id={alert.id}
|
||||
removeAlert={removeAlert}
|
||||
/>
|
||||
|
|
@ -236,20 +243,6 @@ export default function App() {
|
|||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div className="z-40 flex flex-col-reverse">
|
||||
{tempNotificationList.map((alert) => (
|
||||
<div key={alert.id}>
|
||||
{alert.type === "success" && (
|
||||
<SuccessAlert
|
||||
key={alert.id}
|
||||
title={alert.title}
|
||||
id={alert.id}
|
||||
removeAlert={removeAlert}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ export default function IOModal({
|
|||
await buildFlow({
|
||||
input_value: chatValue,
|
||||
startNodeId: chatInput?.id,
|
||||
silent: true,
|
||||
}).catch((err) => {
|
||||
console.error(err);
|
||||
setLockChat(false);
|
||||
|
|
|
|||
|
|
@ -430,10 +430,12 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
|
|||
startNodeId,
|
||||
stopNodeId,
|
||||
input_value,
|
||||
silent,
|
||||
}: {
|
||||
startNodeId?: string;
|
||||
stopNodeId?: string;
|
||||
input_value?: string;
|
||||
silent?: boolean;
|
||||
}) => {
|
||||
get().setIsBuilding(true);
|
||||
const currentFlow = useFlowsManagerStore.getState().currentFlow;
|
||||
|
|
@ -536,19 +538,23 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
|
|||
startNodeId,
|
||||
stopNodeId,
|
||||
onGetOrderSuccess: () => {
|
||||
setNoticeData({ title: "Running components" });
|
||||
if (!silent) {
|
||||
setNoticeData({ title: "Running components" });
|
||||
}
|
||||
},
|
||||
onBuildComplete: (allNodesValid) => {
|
||||
const nodeId = startNodeId || stopNodeId;
|
||||
if (nodeId && allNodesValid) {
|
||||
setSuccessData({
|
||||
title: `${
|
||||
get().nodes.find((node) => node.id === nodeId)?.data.node
|
||||
?.display_name
|
||||
} built successfully`,
|
||||
});
|
||||
} else {
|
||||
setSuccessData({ title: FLOW_BUILD_SUCCESS_ALERT });
|
||||
if (!silent) {
|
||||
if (nodeId && allNodesValid) {
|
||||
setSuccessData({
|
||||
title: `${
|
||||
get().nodes.find((node) => node.id === nodeId)?.data.node
|
||||
?.display_name
|
||||
} built successfully`,
|
||||
});
|
||||
} else {
|
||||
setSuccessData({ title: FLOW_BUILD_SUCCESS_ALERT });
|
||||
}
|
||||
}
|
||||
get().setIsBuilding(false);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -106,11 +106,12 @@ export type FlowStoreType = {
|
|||
startNodeId,
|
||||
stopNodeId,
|
||||
input_value,
|
||||
silent,
|
||||
}: {
|
||||
nodeId?: string;
|
||||
startNodeId?: string;
|
||||
stopNodeId?: string;
|
||||
input_value?: string;
|
||||
silent?: boolean;
|
||||
}) => Promise<void>;
|
||||
getFlow: () => { nodes: Node[]; edges: Edge[]; viewport: Viewport };
|
||||
updateVerticesBuild: (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue