From ec535babc8f0cae8e6aaf575c8b045fff0312f6e Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Thu, 20 Feb 2020 13:20:13 -0500 Subject: [PATCH] slug: move slug check to beforeUpdate Fixes #12 --- frontend/src/components/MainEditor.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/MainEditor.vue b/frontend/src/components/MainEditor.vue index 2a808b6..e2a378d 100644 --- a/frontend/src/components/MainEditor.vue +++ b/frontend/src/components/MainEditor.vue @@ -27,10 +27,14 @@ slug: String }, created() { + this.save = _.debounce(this.save, 2000) + }, + beforeUpdate() { + console.log('checking for slug: '+this.$props.slug) if (this.$props.slug) { + console.log('found slug: '+this.$props.slug) this.getFile(this.$props.slug) } - this.save = _.debounce(this.save, 2000) }, computed: { tags: function () {