chore: clean stale code

This commit is contained in:
Harsh G
2025-06-27 16:31:50 +05:30
committed by GitHub
parent f73d5b6384
commit ba7c4ce9d7

View File

@@ -6,14 +6,14 @@ export interface TextStep {
label: string; label: string;
data: string; data: string;
selectorObj: SelectorObject; selectorObj: SelectorObject;
actionId?: string; // Add actionId to track which action created this step actionId?: string;
} }
interface ScreenshotStep { interface ScreenshotStep {
id: number; id: number;
type: 'screenshot'; type: 'screenshot';
fullPage: boolean; fullPage: boolean;
actionId?: string; // Add actionId to track which action created this step actionId?: string;
} }
export interface ListStep { export interface ListStep {
@@ -26,7 +26,7 @@ export interface ListStep {
selector: string; selector: string;
}; };
limit?: number; limit?: number;
actionId?: string; // Add actionId to track which action created this step actionId?: string;
} }
export type BrowserStep = TextStep | ScreenshotStep | ListStep; export type BrowserStep = TextStep | ScreenshotStep | ListStep;
@@ -50,8 +50,7 @@ interface BrowserStepsContextType {
updateListStepLimit: (listId: number, limit: number) => void; updateListStepLimit: (listId: number, limit: number) => void;
updateListStepData: (listId: number, extractedData: any[]) => void; updateListStepData: (listId: number, extractedData: any[]) => void;
removeListTextField: (listId: number, fieldKey: string) => void; removeListTextField: (listId: number, fieldKey: string) => void;
deleteStepsByActionId: (actionId: string) => void; // New function to delete steps by actionId deleteStepsByActionId: (actionId: string) => void;
}
const BrowserStepsContext = createContext<BrowserStepsContextType | undefined>(undefined); const BrowserStepsContext = createContext<BrowserStepsContextType | undefined>(undefined);
@@ -220,7 +219,7 @@ export const BrowserStepsProvider: React.FC<{ children: React.ReactNode }> = ({
updateListStepLimit, updateListStepLimit,
updateListStepData, updateListStepData,
removeListTextField, removeListTextField,
deleteStepsByActionId, // Export the new function deleteStepsByActionId,
}}> }}>
{children} {children}
</BrowserStepsContext.Provider> </BrowserStepsContext.Provider>
@@ -233,4 +232,4 @@ export const useBrowserSteps = () => {
throw new Error('useBrowserSteps must be used within a BrowserStepsProvider'); throw new Error('useBrowserSteps must be used within a BrowserStepsProvider');
} }
return context; return context;
}; };