Bug fixes
This commit is contained in:
@@ -27,7 +27,10 @@ function DebouncedBookmarkItem({
|
||||
const [bookmark, setBookmark] = useState<Bookmark>(bookmarkItem);
|
||||
const [update, setUpdate] = useState<any>({});
|
||||
const [debounced] = useDebouncedValue(update, 1000);
|
||||
|
||||
const handleClose = () => {
|
||||
setIsOpen(false);
|
||||
closeModal();
|
||||
};
|
||||
useEffect(() => {
|
||||
if (Object.keys(debounced).length) {
|
||||
mutateAsync({ method: 'PATCH', endpoint: 'api/links', body: debounced });
|
||||
@@ -44,7 +47,7 @@ function DebouncedBookmarkItem({
|
||||
<Card className={cardClasses.settingsItem} classNames={cardClasses}>
|
||||
<DeleteItemModal
|
||||
modalOpened={modalOpened}
|
||||
handleClose={closeModal}
|
||||
handleClose={handleClose}
|
||||
body={
|
||||
<Stack gap={0} w={'100%'} h={'150px'} align='center'>
|
||||
<Text>Are you sure you want to delete this bookmark?</Text>
|
||||
@@ -66,7 +69,7 @@ function DebouncedBookmarkItem({
|
||||
styles={{ label: { color: 'black' } }}
|
||||
onClick={() => {
|
||||
handleDelete(bookmark, 'api/links');
|
||||
closeModal();
|
||||
handleClose();
|
||||
}}
|
||||
>
|
||||
Delete
|
||||
@@ -74,9 +77,7 @@ function DebouncedBookmarkItem({
|
||||
<Button
|
||||
color={'grey'}
|
||||
styles={{ label: { color: 'black' } }}
|
||||
onClick={() => {
|
||||
closeModal();
|
||||
}}
|
||||
onClick={handleClose}
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user