Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
JackGruber committed Feb 22, 2021
2 parents c15a974 + 286eee0 commit 93eaae6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v0.3.2 (2021-02-22)

Fix: File is not deleted on tagging error

## v0.3.1 (2021-01-29)

Fix: Folder with a beginning dot is excluded #5
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "joplin-plugin-hotfolder",
"version": "0.3.1",
"version": "0.3.2",
"scripts": {
"dist": "webpack --joplin-plugin-config buildMain && webpack --joplin-plugin-config buildExtraScripts && webpack --joplin-plugin-config createArchive",
"prepare": "npm run dist",
Expand Down
15 changes: 12 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,16 @@ joplin.plugins.register({
if (addTags != null) {
for (let tag of addTags) {
let tagId = await getTagId(tag);
await joplin.data.post(["tags", tagId, "notes"], null, {
id: newNote.id,
});
if(tagId != null) {
try {
await joplin.data.post(["tags", tagId, "notes"], null, {
id: newNote.id,
});
} catch (e) {
console.error("note tagging error");
console.error(e);
}
}
}
}

Expand All @@ -223,6 +230,7 @@ joplin.plugins.register({
}

async function getTagId(tag: string): Promise<string> {
tag = tag.trim();
var query = await joplin.data.get(["search"], {
query: tag,
type: "tag",
Expand All @@ -239,6 +247,7 @@ joplin.plugins.register({
} else {
console.error("More than one tag match!");
console.error(query);
return null;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 1,
"id": "io.github.jackgruber.hotfolder",
"app_min_version": "1.7.1",
"version": "0.3.1",
"version": "0.3.2",
"name": "Hotfolder",
"description": "Monitors a locale folder and import the files as a new note.",
"author": "JackGruber",
Expand Down

0 comments on commit 93eaae6

Please sign in to comment.