mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 01:06:23 +02:00
chore: ran linting
This commit is contained in:
parent
5ebb9d7aea
commit
43e50e90df
3 changed files with 55 additions and 29 deletions
|
|
@ -1,7 +1,15 @@
|
|||
"use client";
|
||||
|
||||
import { useAtomValue } from "jotai";
|
||||
import { type FC, createContext, useContext, useState, useCallback, useRef, type ReactNode } from "react";
|
||||
import {
|
||||
type FC,
|
||||
createContext,
|
||||
useContext,
|
||||
useState,
|
||||
useCallback,
|
||||
useRef,
|
||||
type ReactNode,
|
||||
} from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { activeSearchSpaceIdAtom } from "@/atoms/search-spaces/search-space-query.atoms";
|
||||
import { Dialog, DialogContent } from "@/components/ui/dialog";
|
||||
|
|
@ -45,19 +53,22 @@ export const DocumentUploadDialogProvider: FC<{ children: ReactNode }> = ({ chil
|
|||
}, 300);
|
||||
}, []);
|
||||
|
||||
const handleOpenChange = useCallback((open: boolean) => {
|
||||
if (!open) {
|
||||
// Only close if not already in closing state
|
||||
if (!isClosingRef.current) {
|
||||
closeDialog();
|
||||
const handleOpenChange = useCallback(
|
||||
(open: boolean) => {
|
||||
if (!open) {
|
||||
// Only close if not already in closing state
|
||||
if (!isClosingRef.current) {
|
||||
closeDialog();
|
||||
}
|
||||
} else {
|
||||
// Only open if not in the middle of closing
|
||||
if (!isClosingRef.current) {
|
||||
setIsOpen(true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Only open if not in the middle of closing
|
||||
if (!isClosingRef.current) {
|
||||
setIsOpen(true);
|
||||
}
|
||||
}
|
||||
}, [closeDialog]);
|
||||
},
|
||||
[closeDialog]
|
||||
);
|
||||
|
||||
return (
|
||||
<DocumentUploadDialogContext.Provider value={{ openDialog, closeDialog }}>
|
||||
|
|
@ -98,4 +109,3 @@ const DocumentUploadPopupContent: FC<{
|
|||
</Dialog>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue