Skip to content

Conversation

@ZeroX-DG
Copy link

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 👍

}
}

function getAttachments (markdownContent, storageKey, noteKey) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of the function is missleading.. it only returns certain attachments, won't it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm.. don't know.. if you stay with the name, can you add javadoc explaining what it returns?

e.preventDefault()
}

removeAllAttachments (attachments) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this method should also be in the attachmentManagement-file..?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And a test for it is required

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: Move this into util file

@ZeroX-DG
Copy link
Author

@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.

@ehhc
Copy link
Owner

ehhc commented Aug 28, 2019

I haven't tested your changes, but at first glance they look good

@ehhc ehhc merged commit a9b6598 into ehhc:option_for_attachment_delete Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants