From 85721065fd1cfedab5aab071064c8cd90a4c4a1e Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Wed, 28 Aug 2019 02:26:19 +0900 Subject: [PATCH] Save memo automatically (#5351) * Save memo automatically * Use clearTimeout * Clean up * Clean up --- src/client/app/common/views/widgets/memo.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/app/common/views/widgets/memo.vue b/src/client/app/common/views/widgets/memo.vue index 8a037f03d..b3b668a9a 100644 --- a/src/client/app/common/views/widgets/memo.vue +++ b/src/client/app/common/views/widgets/memo.vue @@ -25,7 +25,8 @@ export default define({ data() { return { text: null, - changed: false + changed: false, + timeoutId: null }; }, @@ -45,6 +46,8 @@ export default define({ onChange() { this.changed = true; + clearTimeout(this.timeoutId); + this.timeoutId = setTimeout(this.saveMemo, 1000); }, saveMemo() {