From ef968d8e1e4f3194a0856fd93bc03d8030112b12 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 25 Sep 2018 15:16:26 +0300 Subject: now it actually works --- src/components/status/status.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/components/status/status.js') diff --git a/src/components/status/status.js b/src/components/status/status.js index 45f5ccac..38cfc5ae 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -174,10 +174,16 @@ const Status = { return true }, replySubject () { - if (this.status.summary && !this.status.summary.match(/^re[: ]/i)) { + if (!this.status.summary) return ''; + const behavior = this.$store.state.config.subjectLineBehavior + const startsWithRe = this.status.summary.match(/^re[: ]/i) + if (behavior !== 'noop' && startsWithRe || behavior === 'masto') { + return this.status.summary + } else if (behavior === 'email') { return 're: '.concat(this.status.summary) + } else if (behavior === 'noop') { + return '' } - return this.status.summary }, attachmentSize () { if ((this.$store.state.config.hideAttachments && !this.inConversation) || -- cgit v1.2.3-70-g09d2 From d5e82625d3e14ed22224de871e732f8b6db9df59 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 25 Sep 2018 15:21:47 +0300 Subject: lint fix --- src/components/status/status.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components/status/status.js') diff --git a/src/components/status/status.js b/src/components/status/status.js index 38cfc5ae..9c224ce3 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -174,7 +174,7 @@ const Status = { return true }, replySubject () { - if (!this.status.summary) return ''; + if (!this.status.summary) return '' const behavior = this.$store.state.config.subjectLineBehavior const startsWithRe = this.status.summary.match(/^re[: ]/i) if (behavior !== 'noop' && startsWithRe || behavior === 'masto') { -- cgit v1.2.3-70-g09d2 From d6ad08050ad0cfcf5ed4a94b5b2e8c66ef27ca0a Mon Sep 17 00:00:00 2001 From: scarlett Date: Sun, 21 Oct 2018 18:04:23 +0100 Subject: Fall back to instance settings consistently --- src/components/status/status.js | 15 +++++++++++---- src/modules/config.js | 1 - 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src/components/status/status.js') diff --git a/src/components/status/status.js b/src/components/status/status.js index 45f5ccac..f1afcac7 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -31,10 +31,17 @@ const Status = { preview: null, showPreview: false, showingTall: false, - expandingSubject: !this.$store.state.config.collapseMessageWithSubject + expandingSubject: typeof this.$store.state.config.collapseMessageWithSubject === 'undefined' + ? !this.$store.state.instance.collapseMessageWithSubject + : !this.$store.state.config.collapseMessageWithSubject } }, computed: { + localCollapseSubjectDefault () { + return typeof this.$store.state.config.collapseMessageWithSubject === 'undefined' + ? this.$store.state.instance.collapseMessageWithSubject + : this.$store.state.config.collapseMessageWithSubject + }, muteWords () { return this.$store.state.config.muteWords }, @@ -147,13 +154,13 @@ const Status = { return this.status.attentions.length > 0 }, hideSubjectStatus () { - if (this.tallStatus && !this.$store.state.config.collapseMessageWithSubject) { + if (this.tallStatus && !this.localCollapseSubjectDefault) { return false } return !this.expandingSubject && this.status.summary }, hideTallStatus () { - if (this.status.summary && this.$store.state.config.collapseMessageWithSubject) { + if (this.status.summary && this.localCollapseSubjectDefault) { return false } if (this.showingTall) { @@ -168,7 +175,7 @@ const Status = { if (!this.status.nsfw) { return false } - if (this.status.summary && this.$store.state.config.collapseMessageWithSubject) { + if (this.status.summary && this.localCollapseSubjectDefault) { return false } return true diff --git a/src/modules/config.js b/src/modules/config.js index 375d0167..1c04845a 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -5,7 +5,6 @@ const browserLocale = (window.navigator.language || 'en').split('-')[0] const defaultState = { colors: {}, - collapseMessageWithSubject: false, hideAttachments: false, hideAttachmentsInConv: false, hideNsfw: true, -- cgit v1.2.3-70-g09d2