fix: only last trashed item being visible in trash

This commit is contained in:
thecodrr
2020-11-01 10:00:31 +05:00
parent 6cda951709
commit 511eeba449
2 changed files with 3 additions and 2 deletions

View File

@@ -62,8 +62,8 @@ const TopicsProfile = createProfile(
const TrashProfile = createProfile(
(index, item) => <TrashItem index={index} item={item} />,
(item) => {
if (item.type === "note") return getNoteHeight(item);
else if (item.type === "notebook") return getNotebookHeight(item);
if (item.itemType === "note") return getNoteHeight(item);
else if (item.itemType === "notebook") return getNotebookHeight(item);
},
Math.max(MAX_HEIGHTS.note, MAX_HEIGHTS.notebook)
);

View File

@@ -11,6 +11,7 @@ function Trash() {
useEffect(() => store.refresh(), []);
const items = useStore((store) => store.trash);
const clearTrash = useStore((store) => store.clear);
console.log(items);
return (
<ListContainer
type="trash"