mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
(nextjs) fixed flow loading, anchors and styles
This commit is contained in:
parent
2e0ad878a3
commit
c5bac54494
11 changed files with 90 additions and 70 deletions
|
@ -2,7 +2,7 @@ import { useCallback, useState } from 'react';
|
|||
import { getNodeDiff } from '~/api/node';
|
||||
import { uniq } from 'ramda';
|
||||
import { useFlowStore } from '~/store/flow/useFlowStore';
|
||||
import { runInAction } from 'mobx';
|
||||
import { runInAction, toJS } from 'mobx';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
|
||||
export const useFlowLoader = () => {
|
||||
|
@ -81,5 +81,7 @@ export const useFlowLoader = () => {
|
|||
}
|
||||
}, [flow]);
|
||||
|
||||
console.log(toJS(flow.nodes));
|
||||
|
||||
return { getInitialNodes, isSyncing, loadMore };
|
||||
};
|
||||
|
|
9
src/hooks/node/useNodePageParams.ts
Normal file
9
src/hooks/node/useNodePageParams.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import { useRouteMatch } from 'react-router';
|
||||
import { useRouter } from 'next/router';
|
||||
import { CONFIG } from '~/utils/config';
|
||||
|
||||
export const useNodePageParams = () => {
|
||||
return CONFIG.isNextEnvironment
|
||||
? (useRouter().query.id as string)
|
||||
: useRouteMatch<{ id: string }>().params.id;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue