Skip to content

Commit

Permalink
removing console.logs
Browse files Browse the repository at this point in the history
  • Loading branch information
kulak-at committed May 19, 2024
1 parent 9877068 commit fb7d14c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
13 changes: 0 additions & 13 deletions src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,33 @@ import { OrganiseCancelError } from "./errors";

export class OrganiseCommand {
async processInboxFiles() {
console.log('Processing inbox files')

const inboxFolder = this.app.vault.getAbstractFileByPath(this.settings.inboxFolder);
console.log('Inbox Folder', inboxFolder);
if (!inboxFolder || !inboxFolder.children || inboxFolder.children.length === 0) {
new Notice("Nothing to Organise",1500)
return;
}
console.log(inboxFolder)

const files = inboxFolder.children.filter((file: TAbstractFile) => file instanceof TAbstractFile);

for (const file of files) {
try {
console.log(file.path)
await this.app.workspace.openLinkText(file.path, file.path);
// await sleep(1000)
const destination = await this.askForDestinationCustom(file);
console.log('got destination???', destination)
if (destination) {
await this.moveFile(file, destination.path);
}

} catch (e) {
if (e instanceof OrganiseCancelError) {
console.log('Cancelled')
break;
}
}
}
}

async askForDestinationCustom(file: TAbstractFile) {
// console.log('LINKZ', this.app.metadataCache.getFileCache(file).links)
// const links = this.app.metadataCache.getFileCache(file).links ?? [];
// const resolvedLinks = links.map((link) => {
// const resolvedPath = this.app.metadataCache.getFirstLinkpathDest(link.link, file.path);
// return resolvedPath
// });
// console.log('RESOLVED LINKS', resolvedLinks)
return new SelectFileModal(this.app, `Organising: ${file.name}`).open();
}

Expand Down
1 change: 0 additions & 1 deletion src/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export class SelectFileModal extends SuggestModal<Folder> {

// Perform action on the selected suggestion.
onChooseSuggestion(folder: Folder, evt: MouseEvent | KeyboardEvent) {
console.log('ON CHOOSE SUGGESTION')
new Notice(`Selected ${folder.title}`);
this.isResolved = true;
this.resolve(folder);
Expand Down

0 comments on commit fb7d14c

Please sign in to comment.