Skip to content

Commit

Permalink
fix: optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshenJ committed Oct 4, 2024
1 parent 56710c8 commit 321a9a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/AllPagesPanel/AllPagesPanel.tsx
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ export const AllPagesPanel: React.FC<AllPagesPanelProps> = (props) => {
onEditModeChanged?.(isEditMode);

if (isEditMode) {
editMenuProps.onOpenEditMode?.();
editMenuProps?.onOpenEditMode?.();
}
}, [isEditMode, onEditModeChanged, editMenuProps]);

@@ -59,7 +59,7 @@ export const AllPagesPanel: React.FC<AllPagesPanelProps> = (props) => {
const originItems = menuItemsRef.current.filter(
(menuItem) => menuItem.id !== ALL_PAGES_ID,
);
editMenuProps.onToggleMenuItem?.(changedItem);
editMenuProps?.onToggleMenuItem?.(changedItem);
onMenuItemsChanged(
originItems.map((menuItem) => {
if (menuItem.id !== changedItem.id) {
@@ -87,7 +87,7 @@ export const AllPagesPanel: React.FC<AllPagesPanelProps> = (props) => {
if (!onMenuItemsChanged) {
return;
}
editMenuProps.onResetSettingsToDefault?.();
editMenuProps?.onResetSettingsToDefault?.();
const originItems = menuItemsRef.current.filter((item) => item.id !== ALL_PAGES_ID);
onMenuItemsChanged(
originItems.map((item) => ({

0 comments on commit 321a9a5

Please sign in to comment.