mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 12:06:35 +08:00
refactor(workspace): rename workspaceId
This commit is contained in:
@@ -9,7 +9,7 @@ import { useParams } from 'react-router-dom';
|
||||
import type { CommentInfo } from './type';
|
||||
|
||||
export const useComments = () => {
|
||||
const { workspace_id: workspaceId, page_id: pageId } = useParams();
|
||||
const { workspaceId, page_id: pageId } = useParams();
|
||||
|
||||
const [comments, setComments] = useState<CommentInfo[]>([]);
|
||||
const [observeIds, setObserveIds] = useState<string[]>([]);
|
||||
@@ -71,7 +71,7 @@ export const useComments = () => {
|
||||
};
|
||||
|
||||
export const useActiveComment = () => {
|
||||
const { workspace_id: workspaceId, page_id: pageId } = useParams();
|
||||
const { workspaceId, page_id: pageId } = useParams();
|
||||
const { currentEditors } = useCurrentEditors();
|
||||
const editor = useMemo(() => {
|
||||
return currentEditors[pageId] as Virgo;
|
||||
|
||||
@@ -7,7 +7,7 @@ interface UseWorkspaceAndPageIdReturn {
|
||||
|
||||
export const useWorkspaceAndPageId = (): UseWorkspaceAndPageIdReturn => {
|
||||
const params = useParams();
|
||||
const workspaceId = params['workspace_id'];
|
||||
const workspaceId = params['workspaceId'];
|
||||
const pageId = params['*'].split('/')[0];
|
||||
return {
|
||||
workspaceId,
|
||||
|
||||
Reference in New Issue
Block a user