diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-01-14 15:40:42 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-01-16 00:00:19 +0100 |
commit | 9a0fa63a5c1f8fa6bb4ce21fd77de55c66aaacbf (patch) | |
tree | 60b9bd86df61ae8d162743fb904436261eda6b91 /apps/files_sharing/src/mixins/SharesMixin.js | |
parent | 3d03d820262cbc75e1356a58d3ef13fac45bcc8c (diff) | |
download | nextcloud-server-9a0fa63a5c1f8fa6bb4ce21fd77de55c66aaacbf.tar.gz nextcloud-server-9a0fa63a5c1f8fa6bb4ce21fd77de55c66aaacbf.zip |
Do not save on update, use submit
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Diffstat (limited to 'apps/files_sharing/src/mixins/SharesMixin.js')
-rw-r--r-- | apps/files_sharing/src/mixins/SharesMixin.js | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js index 19b2a9a6875..2622edaf5e2 100644 --- a/apps/files_sharing/src/mixins/SharesMixin.js +++ b/apps/files_sharing/src/mixins/SharesMixin.js @@ -183,14 +183,25 @@ export default { }, /** + * Note changed, let's save it to a different key + * @param {String} note the share note + */ + onNoteChange(note) { + this.$set(this.share, 'newNote', note.trim()) + }, + + /** * When the note change, we trim, save and dispatch * * @param {string} note the note */ - onNoteChange: debounce(function(note) { - this.share.note = note.trim() - this.queueUpdate('note') - }, 500), + onNoteSubmit() { + if (this.share.newNote) { + this.share.note = this.share.newNote + this.$delete(this.share, 'newNote') + this.queueUpdate('note') + } + }, /** * Delete share button handler |