aboutsummaryrefslogtreecommitdiff
path: root/src/components/status/status.js
diff options
context:
space:
mode:
authortusooa <tusooa@kazv.moe>2023-07-13 00:37:57 -0400
committertusooa <tusooa@kazv.moe>2023-07-17 11:27:32 -0400
commitd22079cf7392a1ef184d7c03ff7cb680e3e1c99c (patch)
tree7e2ce9a116deef6734cbb474303cfb4110a879e3 /src/components/status/status.js
parentd72486f3e4f2af9db95535f3f93e6257c675e155 (diff)
Handle recursive quotes
Diffstat (limited to 'src/components/status/status.js')
-rw-r--r--src/components/status/status.js25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js
index c10c6cf5..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: {
@@ -402,8 +404,17 @@ 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: {
@@ -472,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: {