style: update detail

This commit is contained in:
moonrailgun 2023-10-05 23:12:49 +08:00
parent ea5c237c29
commit 113d49abe9
4 changed files with 14 additions and 3 deletions

View File

@ -96,7 +96,7 @@ export function useSocketSubscribe<T>(
const [data, setData] = useState<T>(defaultData);
const cb = useEvent((_data) => {
setData(_data);
setData(_data ?? defaultData);
});
useEffect(() => {

View File

@ -1,5 +1,5 @@
import { createTRPCReact } from '@trpc/react-query';
import type { AppRouter } from '../../server/trpc';
import type { AppRouter } from '../../server/trpc/routers';
import { httpBatchLink, TRPCClientErrorLike } from '@trpc/client';
import { getJWT } from './auth';
import { message } from 'antd';

View File

@ -131,7 +131,14 @@ const WebsiteListTable: React.FC<{ workspaceId: string }> = React.memo(
return <Loading />;
}
return <Table columns={columns} dataSource={websites} pagination={false} />;
return (
<Table
rowKey="id"
columns={columns}
dataSource={websites}
pagination={false}
/>
);
}
);
WebsiteListTable.displayName = 'WebsiteListTable';

View File

@ -11,6 +11,10 @@ const serverMap: Record<
> = {};
createSubscribeInitializer('onServerStatusUpdate', (workspaceId) => {
if (!serverMap[workspaceId]) {
serverMap[workspaceId] = {};
}
return serverMap[workspaceId];
});