diff --git a/src/context/browserActions.tsx b/src/context/browserActions.tsx index 7ff6f377..ef303f82 100644 --- a/src/context/browserActions.tsx +++ b/src/context/browserActions.tsx @@ -3,7 +3,7 @@ import { useSocketStore } from './socket'; export type PaginationType = 'scrollDown' | 'scrollUp' | 'clickNext' | 'clickLoadMore' | 'none' | ''; export type LimitType = '10' | '100' | 'custom' | ''; -export type CaptureStage = 'initial' | 'pagination' | 'limit' | 'complete'; +export type CaptureStage = 'initial' | 'pagination' | 'limit' | 'complete' | ''; interface ActionContextProps { getText: boolean; @@ -42,7 +42,7 @@ export const ActionProvider = ({ children }: { children: ReactNode }) => { const [paginationType, setPaginationType] = useState(''); const [limitType, setLimitType] = useState(''); const [customLimit, setCustomLimit] = useState(''); - const [captureStage, setCaptureStage] = useState('initial'); // New captureStage state + const [captureStage, setCaptureStage] = useState('initial'); const { socket } = useSocketStore(); @@ -70,6 +70,7 @@ export const ActionProvider = ({ children }: { children: ReactNode }) => { const startGetList = () => { setGetList(true); socket?.emit('setGetList', { getList: true }); + setCaptureStage('initial'); } const stopGetList = () => { @@ -78,7 +79,7 @@ export const ActionProvider = ({ children }: { children: ReactNode }) => { setPaginationType(''); setLimitType(''); setCustomLimit(''); - setCaptureStage('initial'); // Reset captureStage when stopping getList + setCaptureStage('complete'); }; const startGetScreenshot = () => setGetScreenshot(true);