diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2020-07-06 10:45:47 +0300 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2020-07-06 10:45:47 +0300 |
| commit | afdc3f96f0cd83a2f977992f68a30d7a531df7de (patch) | |
| tree | 9db58232bb5db7c9f3956e1741534990aba11aa1 /src/components/post_status_form | |
| parent | 61f34ff361a24a287ac0bf0c79fd2f77b4f2b708 (diff) | |
| parent | b761bcf3334e1f464e63a87de40eb75d0906d545 (diff) | |
fix conflicts, make subject update the preview
Diffstat (limited to 'src/components/post_status_form')
| -rw-r--r-- | src/components/post_status_form/post_status_form.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 732691e7..1bf5dae3 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -171,7 +171,7 @@ const PostStatusForm = { return !!this.preview || this.previewLoading }, emptyStatus () { - return this.newStatus.status === '' && this.newStatus.files.length === 0 + return this.newStatus.status.trim() === '' && this.newStatus.files.length === 0 }, ...mapGetters(['mergedConfig']) }, @@ -182,6 +182,9 @@ const PostStatusForm = { } else if (this.preview) { this.previewStatus(this.newStatus) } + }, + 'newStatus.spoilerText': function () { + this.autoPreview() } }, methods: { @@ -236,7 +239,7 @@ const PostStatusForm = { }) }, previewStatus () { - if (this.emptyStatus) { + if (this.emptyStatus && this.newStatus.spoilerText.trim() === '') { this.preview = { error: this.$t('status.preview_empty') } this.previewLoading = false return @@ -269,7 +272,7 @@ const PostStatusForm = { this.previewLoading = false }) }, - debouncePreviewStatus: debounce(function () { this.previewStatus() }, 750), + debouncePreviewStatus: debounce(function () { this.previewStatus() }, 500), autoPreview () { if (!this.preview) return this.previewLoading = true |
