Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context menu fix #24

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

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