Skip to content

Commit

Permalink
revert: revert LibraryContext defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Dec 10, 2024
1 parent 829cb5a commit c805858
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/library-authoring/common/context/LibraryContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface ComponentEditorInfo {

export type LibraryContextData = {
/** The ID of the current library */
libraryId?: undefined | string;
libraryId: string;
libraryData?: ContentLibrary;
readOnly: boolean;
isLoadingLibraryData: boolean;
Expand Down Expand Up @@ -141,20 +141,7 @@ export function useLibraryContext(): LibraryContextData {
const ctx = useContext(LibraryContext);
if (ctx === undefined) {
/* istanbul ignore next */
return {
libraryId: undefined,
readOnly: true,
isLoadingLibraryData: false,
collectionId: undefined,
setCollectionId: () => {},
showOnlyPublished: false,
isCreateCollectionModalOpen: false,
openCreateCollectionModal: () => {},
closeCreateCollectionModal: () => {},
componentBeingEdited: undefined,
openComponentEditor: () => {},
closeComponentEditor: () => {},
};
throw new Error('useLibraryContext() was used in a component without a <LibraryProvider> ancestor.');
}
return ctx;
}

0 comments on commit c805858

Please sign in to comment.