diff --git a/package.json b/package.json index 918a95ae..67b8f87e 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app", - "version": "5.6.25", + "version": "5.6.26", "description": "", "author": "", "license": "ISC", diff --git a/src/co/bookmarks/edit/form/collection/index.js b/src/co/bookmarks/edit/form/collection/index.js index 7b1e4e06..806ca6c3 100644 --- a/src/co/bookmarks/edit/form/collection/index.js +++ b/src/co/bookmarks/edit/form/collection/index.js @@ -60,11 +60,9 @@ export default function BookmarkEditFormCollection({ item, onChange, onSave }) { - {item?.collectionId <= 0 ? ( - - ) : null} + {pick && ( diff --git a/src/co/bookmarks/edit/form/collection/suggested.js b/src/co/bookmarks/edit/form/collection/suggested.js index f18ec01d..8acc68dd 100644 --- a/src/co/bookmarks/edit/form/collection/suggested.js +++ b/src/co/bookmarks/edit/form/collection/suggested.js @@ -1,23 +1,24 @@ import s from './suggested.module.styl' import React, { useMemo, useCallback } from 'react' -import t from '~t' import { useSelector } from 'react-redux' import { makeSuggestedFields } from '~data/selectors/bookmarks' -import { makeCollection } from '~data/selectors/collections' +import { makeCollectionPath } from '~data/selectors/collections' import { isPro } from '~data/selectors/user' import Button from '~co/common/button' -import CollectionIcon from '~co/collections/item/icon' function Suggestion({ id, onClick }) { - const getCollection = useMemo(()=>makeCollection(), []) - const collection = useSelector(state=>getCollection(state, id)) + const getCollectionPath = useMemo(()=>makeCollectionPath(), []) + const path = useSelector(state=>getCollectionPath(state, id, { self: true })) + const shortPath = useMemo(()=>path.map((p)=>p.title).slice(-2).join(' / '), [path]) + const fullPath = useMemo(()=>path.map((p)=>p.title).join(' / '), [path]) + const collection = useMemo(()=>path?.[path.length-1], [path]) - if (!collection.title) + if (!collection?.title) return null return ( - ) } @@ -51,8 +52,8 @@ export default function BookmarkEditFormCollectionSuggested({ item, events: { on return (
+ className={s.suggested} + data-is-new={item.collectionId <= 0}> {collections.map(id=>(