Skip to content

Commit

Permalink
fix: blocks no key issue
Browse files Browse the repository at this point in the history
  • Loading branch information
EINDEX committed Sep 7, 2024
1 parent cbe41e1 commit c72f352
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/components/LogseqBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type LogseqBlockProps = {

export const LogseqBlock = ({ graph, blocks }: LogseqBlockProps) => {

if(blocks.length === 0) {
if (blocks.length === 0) {
return <></>;
}

Expand Down Expand Up @@ -118,7 +118,7 @@ export const LogseqBlock = ({ graph, blocks }: LogseqBlockProps) => {
{blocks.map((block) => {
if (block.marker != null) {
return (
<li className={styles.blockContentListItem}>
<li key={block.uuid} className={styles.blockContentListItem}>
<div className={styles.blockContentRoot} >
{markerRender(block.marker)}
<div className={styles.blockContent} dangerouslySetInnerHTML={{ __html: block.html }} />
Expand Down
9 changes: 2 additions & 7 deletions src/components/LogseqCopilot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ const LogseqCopilot = ({ graph, pages, blocks }) => {
return groups;
}, {});

console.log({groupedBlocks, blocks})

const count = () => {
return pages.length + blocks.length;
};
Expand All @@ -29,9 +27,7 @@ const LogseqCopilot = ({ graph, pages, blocks }) => {
return (
<div className={styles.blocks}>
{Object.entries(groupedBlocks).map(([key, blocks], i) => {
// return blockGroup.map((block) => {
return <LogseqBlock key={key} blocks={blocks} graph={graph} />;
// });
return <LogseqBlock key={key} blocks={blocks} graph={graph} />;
})}
</div>
);
Expand All @@ -45,9 +41,8 @@ const LogseqCopilot = ({ graph, pages, blocks }) => {
{pages.slice(0, 9).map((page) => {
if (!page) return <></>;
return (
<div className={styles.page}>
<div key={page.name} className={styles.page}>
<LogseqPageLink
key={page.uuid}
graph={graph}
page={page}
></LogseqPageLink>
Expand Down

0 comments on commit c72f352

Please sign in to comment.