mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
#58 fixed lab detection at create dialog
This commit is contained in:
parent
e5ed6361e6
commit
558a97d278
3 changed files with 14 additions and 2 deletions
|
@ -21,7 +21,9 @@ const EditorCreateDialog: FC = () => {
|
|||
|
||||
const isExist = useMemo(() => values(NODE_TYPES).some(el => el === type), [type]);
|
||||
|
||||
const data = useRef({ ...EMPTY_NODE, type });
|
||||
const isInLab = useMemo(() => !!url.match(/^\/lab/), [url]);
|
||||
|
||||
const data = useRef({ ...EMPTY_NODE, type, is_promoted: !isInLab });
|
||||
|
||||
if (!type || !isExist) {
|
||||
return null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue