mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
fixed tag autocomplete behaviour
This commit is contained in:
parent
9dc83b0db8
commit
85d20e5009
8 changed files with 25 additions and 20 deletions
|
@ -15,5 +15,5 @@ export const canLikeNode = (node?: Partial<INode>, user?: Partial<IUser>): boole
|
|||
|
||||
export const canStarNode = (node?: Partial<INode>, user?: Partial<IUser>): boolean =>
|
||||
path(['type'], node) === NODE_TYPES.IMAGE &&
|
||||
path(['is_promoted'], node) === false &&
|
||||
path(['is_promoted'], node) === true &&
|
||||
path(['role'], user) === Role.Admin;
|
||||
|
|
|
@ -15,15 +15,7 @@ const defaultValue: INodeRelated = {
|
|||
};
|
||||
|
||||
const NodeRelatedProvider: FC<NodeRelatedProviderProps> = ({ id, children, tags }) => {
|
||||
const { related, isLoading, refresh } = useGetNodeRelated(id);
|
||||
|
||||
useEffect(
|
||||
() => {
|
||||
refresh();
|
||||
},
|
||||
// eslint-disable-next-line
|
||||
[tags]
|
||||
);
|
||||
const { related, isLoading } = useGetNodeRelated(id);
|
||||
|
||||
return (
|
||||
<NodeRelatedContextProvider related={related || defaultValue} isLoading={isLoading}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue