Skip to content

Commit

Permalink
fix: restore the folders list in move modal of the filter
Browse files Browse the repository at this point in the history
  • Loading branch information
dhavaldodiya committed Sep 29, 2022
1 parent 0a225ae commit b45a7b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/integrations/shared-invite-reply/parts/response-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,15 @@ const ResponseActions: FC<ResponseActionsProps> = ({
const accounts = useUserAccounts();
const calFolders = useFoldersByView(FOLDER_VIEW.appointment);
const showError = useMemo(
() => find(calFolders[0].children, (item) => item.name === calendarName.toLowerCase()),
() =>
find(
calFolders[0].children,
(item) => item.name.toLowerCase() === calendarName.toLowerCase()
),
[calFolders, calendarName]
);
const disabled = useMemo(
() => !calendarName || !calendarName.length || showError,
() => !!(calendarName.length === 0 || showError),
[calendarName, showError]
);
const acceptShare = useCallback(
Expand Down Expand Up @@ -194,7 +198,7 @@ const ResponseActions: FC<ResponseActionsProps> = ({
label={t('label.accept', 'Accept')}
icon="Checkmark"
onClick={acceptShare}
disabled={disabled && false}
disabled={disabled}
/>
<Padding horizontal="small" />
<Button
Expand Down
5 changes: 3 additions & 2 deletions src/views/settings/filters/parts/move-to-folder-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ const FolderSelectModal: FC<ComponentProps> = ({ compProps }): ReactElement => {
if (match && match.length) {
return [
...acc,
{
divider: true
},
{
...item,
label: item.name,
Expand All @@ -81,7 +84,6 @@ const FolderSelectModal: FC<ComponentProps> = ({ compProps }): ReactElement => {
items: nestFilteredFolders(items, item.id, results, getSharedFolder),
onClick: (): void => setFolderDestination(item),
open: !!input.length,
divider: true,
background: folderDestination.id === item.id ? 'highlight' : undefined
}
];
Expand All @@ -103,7 +105,6 @@ const FolderSelectModal: FC<ComponentProps> = ({ compProps }): ReactElement => {
label: 'Shared Folders',
level: '0',
icon: 'Share',
divider: true,
items: nestFilteredFolders(folders, '1', filterFromInput, true),
background: folderDestination.id === '1' ? 'highlight' : undefined,
onClick: (): void => setFolderDestination({ id: '1' })
Expand Down

0 comments on commit b45a7b0

Please sign in to comment.