Skip to content

Conversation

@ShadowFantasy
Copy link

@ShadowFantasy ShadowFantasy commented Feb 21, 2024

The context menu would give the option to create a new spreadsheet when a file was selected. This would produce an error if the option was clicked because it would try to create a new spreadsheet using the file name which is not a directory.

I added an if statement that only gives the option when a directory is selected by checking if the "file" object in the event has a "children" property.

*Edit
Now checks using "instanceof TFolder"

@ShadowFantasy ShadowFantasy changed the title Jaedons changes Context menu fix Feb 22, 2024
Rather than checking if it has children, it now checks if it is an instance of a TFolder. Which is obsidian's way of typing folders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant