Fixing types

pull/929/head
TomasMatarazzo 2 months ago
parent fc170d3033
commit b84842df3d

@ -3,6 +3,7 @@ import { ActiveState } from '../models/misc';
import { useMediaQuery, useOutsideAlerter } from './../hooks'; import { useMediaQuery, useOutsideAlerter } from './../hooks';
import Modal from '../Modal'; import Modal from '../Modal';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import { Action } from '@reduxjs/toolkit';
export default function DeleteConvModal({ export default function DeleteConvModal({
modalState, modalState,
@ -10,7 +11,7 @@ export default function DeleteConvModal({
handleDeleteAllConv, handleDeleteAllConv,
}: { }: {
modalState: ActiveState; modalState: ActiveState;
setModalState: (val: ActiveState) => void; setModalState: (val: ActiveState) => Action;
handleDeleteAllConv: () => void; handleDeleteAllConv: () => void;
}) { }) {
const dispatch = useDispatch(); const dispatch = useDispatch();

@ -1,4 +1,5 @@
import { import {
PayloadAction,
createListenerMiddleware, createListenerMiddleware,
createSlice, createSlice,
isAnyOf, isAnyOf,
@ -34,7 +35,7 @@ const initialState: Preference = {
} as Doc, } as Doc,
sourceDocs: null, sourceDocs: null,
conversations: null, conversations: null,
modalState: 'ACTIVE', modalState: 'INACTIVE',
}; };
export const prefSlice = createSlice({ export const prefSlice = createSlice({
@ -59,7 +60,7 @@ export const prefSlice = createSlice({
setChunks: (state, action) => { setChunks: (state, action) => {
state.chunks = action.payload; state.chunks = action.payload;
}, },
setModalStateDeleteConv: (state, action) => { setModalStateDeleteConv: (state, action: PayloadAction<ActiveState>) => {
state.modalState = action.payload; state.modalState = action.payload;
}, },
}, },

Loading…
Cancel
Save