Skip to content

Commit

Permalink
docs: Comments on the code
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisChV committed Apr 26, 2024
1 parent 1fe6282 commit cf746b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/content-tags-drawer/ContentTagsDrawerHelper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ const useContentTagsDrawerContext = (contentId) => {

if (setBlockingSheet) {
const areChangesInTags = () => {
// It is calculated in this way, because there are cases in which
// there are keys in the map, but they contain empty lists
// (e.g. add a tag, and remove the same tag later).

const tagsAddedList = Object.values(globalStagedContentTags);
const tagsRemovedList = Object.values(globalStagedRemovedContentTags);

Expand Down
5 changes: 5 additions & 0 deletions src/content-tags-drawer/common/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ export const ContentTagsDrawerContext = React.createContext({
setCollapsibleToInitalState: /** @type{() => void} */ (() => {}),
});

// This context has not been added to ContentTagsDrawerContext because it has been
// created one level higher to control the behavior of the Sheet that contatins the Drawer.
// This logic is not used in legacy edx-platform screens. But it can be separated if we keep
// the contexts separate.
// TODO We can join both contexts when the Drawer is no longer used on edx-platform
/* istanbul ignore next */
export const ContentTagsDrawerSheetContext = React.createContext({
blockingSheet: /** @type{boolean} */ (false),
Expand Down

0 comments on commit cf746b4

Please sign in to comment.