Skip to content

Commit

Permalink
fix: switch space not refresh (#1359)
Browse files Browse the repository at this point in the history
  • Loading branch information
tea-artist authored Feb 28, 2025
1 parent 4fd2275 commit d7e5de0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { updateBaseOrder } from '@teable/openapi';
import { useIsHydrated } from '@teable/sdk';
import { DndKitContext, Droppable, Draggable } from '@teable/ui-lib/base';
import type { DragEndEvent } from '@teable/ui-lib/base';
import { useState } from 'react';
import { useEffect, useState } from 'react';
import { BaseCard } from './BaseCard';

interface IDraggableBaseGridProps {
Expand All @@ -17,6 +17,10 @@ const DraggableBaseGrid = (props: IDraggableBaseGridProps) => {
const isHydrated = useIsHydrated();
const [innerBases, setInnerBases] = useState<IGetBaseAllVo>(bases);

useEffect(() => {
setInnerBases(bases);
}, [bases]);

const { mutateAsync: updateBaseFn } = useMutation({
mutationFn: updateBaseOrder,
onSuccess: () => {
Expand Down

0 comments on commit d7e5de0

Please sign in to comment.