From 950f61d12da49d10aae61f4df5fff212bb5324a9 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Thu, 9 Mar 2023 19:01:43 -0300 Subject: [PATCH] alert after download flow --- langflow/frontend/src/contexts/tabsContext.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/langflow/frontend/src/contexts/tabsContext.tsx b/langflow/frontend/src/contexts/tabsContext.tsx index 7b3f60e06..ba148f2d9 100644 --- a/langflow/frontend/src/contexts/tabsContext.tsx +++ b/langflow/frontend/src/contexts/tabsContext.tsx @@ -1,7 +1,8 @@ -import { createContext, useEffect, useState, useRef, ReactNode } from "react"; +import { createContext, useEffect, useState, useRef, ReactNode, useContext } from "react"; import { FlowType } from "../types/flow"; import { TabsContextType } from "../types/tabs"; import { normalCaseToSnakeCase } from "../utils"; +import { alertContext } from "./alertContext"; const TabsContextInitialValue: TabsContextType = { tabIndex: 0, @@ -20,6 +21,7 @@ export const TabsContext = createContext( ); export function TabsProvider({ children }: { children: ReactNode }) { + const {setNoticeData} = useContext(alertContext) const [tabIndex, setTabIndex] = useState(0); const [flows, setFlows] = useState>([]); const [id, setId] = useState(0); @@ -66,6 +68,7 @@ export function TabsProvider({ children }: { children: ReactNode }) { // simulate a click on the link element to trigger the download link.click(); + setNoticeData({title:"Warning: Critical data, including API keys, in JSON file. Keep secure and do not share."}) } /**