Skip to content

Commit

Permalink
Merge pull request #465 from reorproject/chat-low-hanging-fruit
Browse files Browse the repository at this point in the history
fix newfile bug
  • Loading branch information
samlhuillier authored Oct 22, 2024
2 parents da9b442 + 5ff4aab commit be63694
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/Sidebars/FileSideBar/FileItemRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ const FileItemRows: React.FC<ListChildComponentProps> = ({ index, style, data })

const renderContextMenuItems = () => (
<>
<ContextMenuItem onClick={() => createUntitledNote(isDirectory ? file.path : window.path.dirname(file.path))}>
New File
<ContextMenuItem
onClick={async () => createUntitledNote(isDirectory ? file.path : await window.path.dirname(file.path))}
>
New file
</ContextMenuItem>
<ContextMenuItem onClick={openNewDirectoryModal}>New Folder</ContextMenuItem>
<ContextMenuItem onClick={openNewDirectoryModal}>New folder</ContextMenuItem>
<ContextMenuItem onClick={() => setNoteToBeRenamed(file.path)}>Rename</ContextMenuItem>
<ContextMenuItem onClick={handleDelete}>Delete</ContextMenuItem>
</>
Expand Down
1 change: 1 addition & 0 deletions src/contexts/ContentContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const ContentProvider: React.FC<ContentProviderProps> = ({ children }) =>

const createUntitledNote = useCallback(
async (parentDirectory?: string) => {
console.log('parentDirectory: ', parentDirectory)

Check warning on line 60 in src/contexts/ContentContext.tsx

View workflow job for this annotation

GitHub Actions / build_and_package (macos-latest)

Unexpected console statement

Check warning on line 60 in src/contexts/ContentContext.tsx

View workflow job for this annotation

GitHub Actions / build_and_package (windows-latest)

Unexpected console statement

Check warning on line 60 in src/contexts/ContentContext.tsx

View workflow job for this annotation

GitHub Actions / build_and_package (ubuntu-latest, x64)

Unexpected console statement
const directoryToMakeFileIn =
parentDirectory ||
(currentlyOpenFilePath && (await window.path.dirname(currentlyOpenFilePath))) ||
Expand Down

0 comments on commit be63694

Please sign in to comment.