Skip to content

Commit 497d32b

Browse files
committed
fix: Fixed the navigate from explore page
1 parent 4af9374 commit 497d32b

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/pages/Correlation/components/SavedCorrelationItem.tsx

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import { Stack, Box, Button, Text, px, Code } from '@mantine/core';
1+
import { Box, Button, Code, Stack, Text, px } from '@mantine/core';
2+
import { FC, useCallback, useState } from 'react';
23
import { IconClock, IconEye, IconEyeOff, IconTrash, IconX } from '@tabler/icons-react';
3-
import { useState, useCallback, FC } from 'react';
4-
import classes from '../styles/SavedCorrelationItem.module.css';
4+
import { correlationStoreReducers, useCorrelationStore } from '../providers/CorrelationProvider';
5+
56
import { Correlation } from '@/@types/parseable/api/correlation';
6-
import dayjs from 'dayjs';
77
import IconButton from '@/components/Button/IconButton';
8+
import classes from '../styles/SavedCorrelationItem.module.css';
9+
import dayjs from 'dayjs';
810
import { useCorrelationsQuery } from '@/hooks/useCorrelations';
9-
import { correlationStoreReducers, useCorrelationStore } from '../providers/CorrelationProvider';
1011

11-
const { toggleSavedCorrelationsModal, setCorrelationId } = correlationStoreReducers;
12+
const { toggleSavedCorrelationsModal, setCorrelationId, cleanCorrelationStore } = correlationStoreReducers;
1213

1314
const renderDeleteIcon = () => <IconTrash size={px('1rem')} stroke={1.5} />;
1415
const renderCloseIcon = () => <IconX size={px('1rem')} stroke={1.5} />;
@@ -105,6 +106,7 @@ const SavedCorrelationItem = (props: { item: Correlation }) => {
105106
}, []);
106107

107108
const onCorrelationAppy = useCallback(() => {
109+
setCorrelationData(cleanCorrelationStore);
108110
setCorrelationData((store) => setCorrelationId(store, id));
109111
closeModal();
110112
}, []);

src/pages/Correlation/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ const Correlation = () => {
196196
}
197197
}, [loadingState, currentPage]);
198198

199-
if (isLoading || !Object.keys(fields)) return;
199+
if (isLoading || !Object.keys(fields) || !Object.keys(selectedFields)) return;
200200

201201
return (
202202
<Box className={classes.correlationWrapper}>

0 commit comments

Comments
 (0)