mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-12-02 18:13:13 +00:00
now is working in settings
This commit is contained in:
@@ -2,6 +2,7 @@ import { useRef } from 'react';
|
||||
import { ActiveState } from '../models/misc';
|
||||
import { useMediaQuery, useOutsideAlerter } from './../hooks';
|
||||
import Modal from '../Modal';
|
||||
import { useDispatch } from 'react-redux';
|
||||
|
||||
export default function DeleteConvModal({
|
||||
modalState,
|
||||
@@ -12,7 +13,7 @@ export default function DeleteConvModal({
|
||||
setModalState: (val: ActiveState) => void;
|
||||
handleDeleteAllConv: () => void;
|
||||
}) {
|
||||
// const dispatch = useDispatch()
|
||||
const dispatch = useDispatch();
|
||||
const modalRef = useRef(null);
|
||||
const { isMobile } = useMediaQuery();
|
||||
|
||||
@@ -20,7 +21,7 @@ export default function DeleteConvModal({
|
||||
modalRef,
|
||||
() => {
|
||||
if (isMobile && modalState === 'ACTIVE') {
|
||||
setModalState('INACTIVE');
|
||||
dispatch(setModalState('INACTIVE'));
|
||||
}
|
||||
},
|
||||
[modalState],
|
||||
@@ -28,11 +29,11 @@ export default function DeleteConvModal({
|
||||
|
||||
function handleSubmit() {
|
||||
handleDeleteAllConv();
|
||||
setModalState('INACTIVE');
|
||||
dispatch(setModalState('INACTIVE'));
|
||||
}
|
||||
|
||||
function handleCancel() {
|
||||
setModalState('INACTIVE');
|
||||
dispatch(setModalState('INACTIVE'));
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -121,7 +121,7 @@ export const selectSelectedDocsStatus = (state: RootState) =>
|
||||
!!state.preference.selectedDocs;
|
||||
export const selectSourceDocs = (state: RootState) =>
|
||||
state.preference.sourceDocs;
|
||||
export const selectModalState = (state: RootState) =>
|
||||
export const selectModalStateDeleteConv = (state: RootState) =>
|
||||
state.preference.modalState;
|
||||
export const selectSelectedDocs = (state: RootState) =>
|
||||
state.preference.selectedDocs;
|
||||
|
||||
Reference in New Issue
Block a user