mirror of
https://github.com/lostpaul/obsidian-folder-notes.git
synced 2026-07-22 07:40:24 +00:00
Fix choose folder note type modal
This commit is contained in:
parent
d050217f5b
commit
4d6820dc53
3 changed files with 4 additions and 0 deletions
|
|
@ -42,6 +42,7 @@ export async function createFolderNote(plugin: FolderNotesPlugin, folderPath: st
|
|||
folderNoteType = '.md';
|
||||
extension = '.excalidraw';
|
||||
} else if (folderNoteType === '.ask') {
|
||||
if (plugin.askModalCurrentlyOpen) return;
|
||||
return new AskForExtensionModal(plugin, folderPath, openFile, folderNoteType, displayModal, preexistingNote).open();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ export default class FolderNotesPlugin extends Plugin {
|
|||
hoverLinkTriggered = false;
|
||||
tabManager: TabManager;
|
||||
settingsOpened = false;
|
||||
askModalCurrentlyOpen = false;
|
||||
|
||||
private fileExplorerPlugin!: InternalPlugin;
|
||||
private fileExplorerView!: FileExplorerView;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ export class AskForExtensionModal extends FuzzySuggestModal<string> {
|
|||
this.openFile = openFile;
|
||||
this.useModal = useModal;
|
||||
this.existingNote = existingNote;
|
||||
plugin.askModalCurrentlyOpen = true;
|
||||
}
|
||||
|
||||
getItems(): string[] {
|
||||
|
|
@ -27,6 +28,7 @@ export class AskForExtensionModal extends FuzzySuggestModal<string> {
|
|||
}
|
||||
|
||||
onChooseItem(item: string, evt: MouseEvent | KeyboardEvent) {
|
||||
this.plugin.askModalCurrentlyOpen = false;
|
||||
this.extension = '.' + item;
|
||||
createFolderNote(this.plugin, this.folderPath, this.openFile, this.extension, this.useModal, this.existingNote);
|
||||
this.close();
|
||||
|
|
|
|||
Loading…
Reference in a new issue