Allow user to view attachments and clear unused attachments#1
Conversation
| } | ||
| } | ||
|
|
||
| function getAttachments (markdownContent, storageKey, noteKey) { |
There was a problem hiding this comment.
The name of the function is missleading.. it only returns certain attachments, won't it?
There was a problem hiding this comment.
Well it get attachment paths for 3 type of attachments:
- Existing attachments
- Existing attachments that are in use
- Existing attachments that aren't in use
What name should I put it? How about getAttachmentsPath?
There was a problem hiding this comment.
hm.. don't know.. if you stay with the name, can you add javadoc explaining what it returns?
| e.preventDefault() | ||
| } | ||
|
|
||
| removeAllAttachments (attachments) { |
There was a problem hiding this comment.
Maybe this method should also be in the attachmentManagement-file..?
There was a problem hiding this comment.
If I'm gonna put it in attachmentManagement, maybe I should change the getAttachments function return types to compatible with this. Well I plan to do that anyway, let's do it.
| }) | ||
| } | ||
|
|
||
| function humanFileSize (bytes) { |
There was a problem hiding this comment.
Note to self: Move this into util file
|
@ehhc I have re-organized the code and added some comments for return types + added test. Tell me if I need to change anything else. |
|
I haven't tested your changes, but at first glance they look good |
Hi @ehhc
I have added a section in setting to allow user to view attachments and clear unused attachments.
Feel free to tell me if you need me to fix something. Thanks 👍