Skip to content

Commit

Permalink
fix: load issue
Browse files Browse the repository at this point in the history
  • Loading branch information
maxakuru committed Jun 22, 2023
1 parent d6aae57 commit fc317b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion prisma/prisma-cloud/blocks/article/article.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export default async function decorate(block) {
if (bookContent) {
decorateMain(bookContent);
loadBlocks(bookContent).then(() => {
updateSectionsStatus(document.querySelector('main'));

This comment has been minimized.

Copy link
@icaraps

icaraps Jul 6, 2023

Contributor

@maxakuru Shouldn't loadBlocks automatically update the section status by default ?

export async function loadBlocks(main) {
  updateSectionsStatus(main);
  const blocks = [...main.querySelectorAll('div.block')];
  for (let i = 0; i < blocks.length; i += 1) {
    // eslint-disable-next-line no-await-in-loop
    await loadBlock(blocks[i]);
    updateSectionsStatus(main);
  }
}
updateSectionsStatus(bookContent);
});
}
}
Expand Down
3 changes: 2 additions & 1 deletion prisma/prisma-cloud/blocks/fragment/fragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '../../scripts/scripts.js';

import {
loadBlocks,
loadBlocks, updateSectionsStatus,
} from '../../scripts/lib-franklin.js';

/**
Expand Down Expand Up @@ -72,6 +72,7 @@ async function loadFragment(path, fromDocs) {

decorateMain(main);
await loadBlocks(main);
updateSectionsStatus(main);
return main;
}

Expand Down

0 comments on commit fc317b1

Please sign in to comment.