feat: capture stage
This commit is contained in:
@@ -3,7 +3,7 @@ import { useSocketStore } from './socket';
|
|||||||
|
|
||||||
export type PaginationType = 'scrollDown' | 'scrollUp' | 'clickNext' | 'clickLoadMore' | 'none' | '';
|
export type PaginationType = 'scrollDown' | 'scrollUp' | 'clickNext' | 'clickLoadMore' | 'none' | '';
|
||||||
export type LimitType = '10' | '100' | 'custom' | '';
|
export type LimitType = '10' | '100' | 'custom' | '';
|
||||||
export type CaptureStage = 'initial' | 'pagination' | 'limit' | 'complete';
|
export type CaptureStage = 'initial' | 'pagination' | 'limit' | 'complete' | '';
|
||||||
|
|
||||||
interface ActionContextProps {
|
interface ActionContextProps {
|
||||||
getText: boolean;
|
getText: boolean;
|
||||||
@@ -42,7 +42,7 @@ export const ActionProvider = ({ children }: { children: ReactNode }) => {
|
|||||||
const [paginationType, setPaginationType] = useState<PaginationType>('');
|
const [paginationType, setPaginationType] = useState<PaginationType>('');
|
||||||
const [limitType, setLimitType] = useState<LimitType>('');
|
const [limitType, setLimitType] = useState<LimitType>('');
|
||||||
const [customLimit, setCustomLimit] = useState<string>('');
|
const [customLimit, setCustomLimit] = useState<string>('');
|
||||||
const [captureStage, setCaptureStage] = useState<CaptureStage>('initial'); // New captureStage state
|
const [captureStage, setCaptureStage] = useState<CaptureStage>('initial');
|
||||||
|
|
||||||
const { socket } = useSocketStore();
|
const { socket } = useSocketStore();
|
||||||
|
|
||||||
@@ -70,6 +70,7 @@ export const ActionProvider = ({ children }: { children: ReactNode }) => {
|
|||||||
const startGetList = () => {
|
const startGetList = () => {
|
||||||
setGetList(true);
|
setGetList(true);
|
||||||
socket?.emit('setGetList', { getList: true });
|
socket?.emit('setGetList', { getList: true });
|
||||||
|
setCaptureStage('initial');
|
||||||
}
|
}
|
||||||
|
|
||||||
const stopGetList = () => {
|
const stopGetList = () => {
|
||||||
@@ -78,7 +79,7 @@ export const ActionProvider = ({ children }: { children: ReactNode }) => {
|
|||||||
setPaginationType('');
|
setPaginationType('');
|
||||||
setLimitType('');
|
setLimitType('');
|
||||||
setCustomLimit('');
|
setCustomLimit('');
|
||||||
setCaptureStage('initial'); // Reset captureStage when stopping getList
|
setCaptureStage('complete');
|
||||||
};
|
};
|
||||||
|
|
||||||
const startGetScreenshot = () => setGetScreenshot(true);
|
const startGetScreenshot = () => setGetScreenshot(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user