Conversation
src/index.ts
Outdated
| if (templateId) { | ||
| await joplin.settings.setValue("defaultTodoTemplateId", templateId); | ||
| await joplin.views.dialogs.showMessageBox("Default to-do template set successfully!"); | ||
| } |
There was a problem hiding this comment.
You might want to consider combining this and the above command for code re-usability sake. You could create a function that takes the setting name, and a dialog box message and call it from here and the default template command.
There was a problem hiding this comment.
I think we can do this later on. Because the code is repeated just two times and it's only 2 lines of code. Also, that would improve the complexity of the code, so I don't think it's worth doing right now.
There was a problem hiding this comment.
Fair enough, you're the owner of this codebase so these calls are ultimately yours.
src/index.ts
Outdated
| return; | ||
| } | ||
| } | ||
| await joplin.views.dialogs.showMessageBox("No default to-do template is set."); |
There was a problem hiding this comment.
Same comment as above.
|
The functionality is complete. I'll address the review comments asap. |
src/views/defaultTemplates.ts
Outdated
| <table> | ||
| <tr> | ||
| <td><u> Note </u></td> | ||
| <td>${noteTemplate ? noteTemplate : "<i>Not set</i>"}</td> |
There was a problem hiding this comment.
You need to escape this variable using HTML entities, for example using a lib like this: https://www.npmjs.com/package/html-entities
There was a problem hiding this comment.
Nice catch! Done!
src/views/defaultTemplates.ts
Outdated
| </tr> | ||
| <tr> | ||
| <td><u> To-do </u></td> | ||
| <td>${todoTemplate ? todoTemplate : "<i>Not set</i>"}</td> |
There was a problem hiding this comment.
Same here, this variable needs to be escaped.
No description provided.