feat: add current action id funcs
This commit is contained in:
@@ -80,6 +80,12 @@ interface GlobalInfo {
|
|||||||
}) => void;
|
}) => void;
|
||||||
shouldResetInterpretationLog: boolean;
|
shouldResetInterpretationLog: boolean;
|
||||||
resetInterpretationLog: () => void;
|
resetInterpretationLog: () => void;
|
||||||
|
currentTextActionId: string;
|
||||||
|
setCurrentTextActionId: (actionId: string) => void;
|
||||||
|
currentListActionId: string;
|
||||||
|
setCurrentListActionId: (actionId: string) => void;
|
||||||
|
currentScreenshotActionId: string;
|
||||||
|
setCurrentScreenshotActionId: (actionId: string) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GlobalInfoStore implements Partial<GlobalInfo> {
|
class GlobalInfoStore implements Partial<GlobalInfo> {
|
||||||
@@ -106,6 +112,9 @@ class GlobalInfoStore implements Partial<GlobalInfo> {
|
|||||||
hasScrapeSchemaAction: false,
|
hasScrapeSchemaAction: false,
|
||||||
};
|
};
|
||||||
shouldResetInterpretationLog = false;
|
shouldResetInterpretationLog = false;
|
||||||
|
currentTextActionId = '';
|
||||||
|
currentListActionId = '';
|
||||||
|
currentScreenshotActionId = '';
|
||||||
};
|
};
|
||||||
|
|
||||||
const globalInfoStore = new GlobalInfoStore();
|
const globalInfoStore = new GlobalInfoStore();
|
||||||
@@ -129,6 +138,9 @@ export const GlobalInfoProvider = ({ children }: { children: JSX.Element }) => {
|
|||||||
const [recordingUrl, setRecordingUrl] = useState<string>(globalInfoStore.recordingUrl);
|
const [recordingUrl, setRecordingUrl] = useState<string>(globalInfoStore.recordingUrl);
|
||||||
const [currentWorkflowActionsState, setCurrentWorkflowActionsState] = useState(globalInfoStore.currentWorkflowActionsState);
|
const [currentWorkflowActionsState, setCurrentWorkflowActionsState] = useState(globalInfoStore.currentWorkflowActionsState);
|
||||||
const [shouldResetInterpretationLog, setShouldResetInterpretationLog] = useState<boolean>(globalInfoStore.shouldResetInterpretationLog);
|
const [shouldResetInterpretationLog, setShouldResetInterpretationLog] = useState<boolean>(globalInfoStore.shouldResetInterpretationLog);
|
||||||
|
const [currentTextActionId, setCurrentTextActionId] = useState<string>('');
|
||||||
|
const [currentListActionId, setCurrentListActionId] = useState<string>('');
|
||||||
|
const [currentScreenshotActionId, setCurrentScreenshotActionId] = useState<string>('');
|
||||||
|
|
||||||
const notify = (severity: 'error' | 'warning' | 'info' | 'success', message: string) => {
|
const notify = (severity: 'error' | 'warning' | 'info' | 'success', message: string) => {
|
||||||
setNotification({ severity, message, isOpen: true });
|
setNotification({ severity, message, isOpen: true });
|
||||||
@@ -187,6 +199,12 @@ export const GlobalInfoProvider = ({ children }: { children: JSX.Element }) => {
|
|||||||
setCurrentWorkflowActionsState,
|
setCurrentWorkflowActionsState,
|
||||||
shouldResetInterpretationLog,
|
shouldResetInterpretationLog,
|
||||||
resetInterpretationLog,
|
resetInterpretationLog,
|
||||||
|
currentTextActionId,
|
||||||
|
setCurrentTextActionId,
|
||||||
|
currentListActionId,
|
||||||
|
setCurrentListActionId,
|
||||||
|
currentScreenshotActionId,
|
||||||
|
setCurrentScreenshotActionId,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
Reference in New Issue
Block a user