mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
updated loader state
Signed-off-by: JeevaRamanathan M <jeevaramanathan.m@infosys.com>
This commit is contained in:
@@ -72,6 +72,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
|
|||||||
const conversations = useSelector(selectConversations);
|
const conversations = useSelector(selectConversations);
|
||||||
const modalStateDeleteConv = useSelector(selectModalStateDeleteConv);
|
const modalStateDeleteConv = useSelector(selectModalStateDeleteConv);
|
||||||
const conversationId = useSelector(selectConversationId);
|
const conversationId = useSelector(selectConversationId);
|
||||||
|
const [isDeletingConversation, setIsDeletingConversation] = useState(false);
|
||||||
|
|
||||||
const { isMobile } = useMediaQuery();
|
const { isMobile } = useMediaQuery();
|
||||||
const [isDarkTheme] = useDarkTheme();
|
const [isDarkTheme] = useDarkTheme();
|
||||||
@@ -114,6 +115,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleDeleteAllConversations = () => {
|
const handleDeleteAllConversations = () => {
|
||||||
|
setIsDeletingConversation(true);
|
||||||
conversationService
|
conversationService
|
||||||
.deleteAll()
|
.deleteAll()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@@ -123,6 +125,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleDeleteConversation = (id: string) => {
|
const handleDeleteConversation = (id: string) => {
|
||||||
|
setIsDeletingConversation(true);
|
||||||
conversationService
|
conversationService
|
||||||
.delete(id, {})
|
.delete(id, {})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@@ -311,7 +314,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
|
|||||||
id="conversationsMainDiv"
|
id="conversationsMainDiv"
|
||||||
className="mb-auto h-[78vh] overflow-y-auto overflow-x-hidden dark:text-white"
|
className="mb-auto h-[78vh] overflow-y-auto overflow-x-hidden dark:text-white"
|
||||||
>
|
>
|
||||||
{conversations?.loading && (
|
{conversations?.loading && !isDeletingConversation && (
|
||||||
<div className="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2">
|
<div className="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2">
|
||||||
<img
|
<img
|
||||||
src={isDarkTheme ? SpinnerDark : Spinner}
|
src={isDarkTheme ? SpinnerDark : Spinner}
|
||||||
|
|||||||
Reference in New Issue
Block a user