diff options
| author | tusooa <tusooa@kazv.moe> | 2023-08-19 02:33:26 +0000 |
|---|---|---|
| committer | tusooa <tusooa@kazv.moe> | 2023-08-19 02:33:26 +0000 |
| commit | f059c1f314be5979d32cd5726b28fd1b21738972 (patch) | |
| tree | 896836b3c533fa940c45ebc68f0a44c766fade3c /src/components/status/status.js | |
| parent | a1641193b5b7c72e919b9848b167bc4d4a40444b (diff) | |
| parent | 1b081a927288ff2f43025d688e2fa15cf6ce6be1 (diff) | |
Merge branch 'tusooa/quote' into 'develop'
Quote
See merge request pleroma/pleroma-fe!1846
Diffstat (limited to 'src/components/status/status.js')
| -rw-r--r-- | src/components/status/status.js | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js index 9a9bca7a..e722a635 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -133,6 +133,7 @@ const Status = { 'showPinned', 'inProfile', 'profileUserId', + 'inQuote', 'simpleTree', 'controlledThreadDisplayStatus', @@ -159,7 +160,8 @@ const Status = { uncontrolledMediaPlaying: [], suspendable: true, error: null, - headTailLinks: null + headTailLinks: null, + displayQuote: !this.inQuote } }, computed: { @@ -401,6 +403,18 @@ const Status = { }, editingAvailable () { return this.$store.state.instance.editingAvailable + }, + hasVisibleQuote () { + return this.status.quote_url && this.status.quote_visible + }, + hasInvisibleQuote () { + return this.status.quote_url && !this.status.quote_visible + }, + quotedStatus () { + return this.status.quote_id ? this.$store.state.statuses.allStatusesObject[this.status.quote_id] : undefined + }, + shouldDisplayQuote () { + return this.quotedStatus && this.displayQuote } }, methods: { @@ -469,6 +483,18 @@ const Status = { window.scrollBy(0, rect.bottom - window.innerHeight + 50) } } + }, + toggleDisplayQuote () { + if (this.shouldDisplayQuote) { + this.displayQuote = false + } else if (!this.quotedStatus) { + this.$store.dispatch('fetchStatus', this.status.quote_id) + .then(() => { + this.displayQuote = true + }) + } else { + this.displayQuote = true + } } }, watch: { |
