From 790693d8470b73c9a5149befb94f3fc1b4308d25 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Tue, 10 Sep 2024 02:33:56 +0530 Subject: [PATCH] feat: move recordingName to global context --- src/context/globalInfo.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/context/globalInfo.tsx b/src/context/globalInfo.tsx index e7eb2ed2..e0efb678 100644 --- a/src/context/globalInfo.tsx +++ b/src/context/globalInfo.tsx @@ -16,6 +16,8 @@ interface GlobalInfo { setRerenderRuns: (rerenderRuns: boolean) => void; recordingLength: number; setRecordingLength: (recordingLength: number) => void; + recordingName: string; + setRecordingName: (recordingName: string) => void; }; class GlobalInfoStore implements Partial { @@ -29,6 +31,7 @@ class GlobalInfoStore implements Partial { }; recordings: string[] = []; rerenderRuns = false; + recordingName = ''; }; const globalInfoStore = new GlobalInfoStore(); @@ -43,6 +46,7 @@ export const GlobalInfoProvider = ({ children }: { children: JSX.Element }) => { const [recordings, setRecordings] = useState(globalInfoStore.recordings); const [rerenderRuns, setRerenderRuns] = useState(globalInfoStore.rerenderRuns); const [recordingLength, setRecordingLength] = useState(globalInfoStore.recordingLength); + const [recordingName, setRecordingName] = useState(globalInfoStore.recordingName); const notify = (severity: 'error' | 'warning' | 'info' | 'success', message: string) => { setNotification({ severity, message, isOpen: true }); @@ -75,6 +79,8 @@ export const GlobalInfoProvider = ({ children }: { children: JSX.Element }) => { setRerenderRuns, recordingLength, setRecordingLength, + recordingName, + setRecordingName }} > {children}