From 710856ef99a90f264bf2366b02733832e2067443 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 9 Mar 2019 18:52:23 +0200 Subject: [PATCH] emulating is_local for mastoapi --- src/components/status/status.js | 10 ++++++++++ src/components/status/status.vue | 2 +- .../entity_normalizer/entity_normalizer.service.js | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/status/status.js b/src/components/status/status.js index 9e18fe15..7f25f1be 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -49,6 +49,16 @@ const Status = { ? this.$store.state.instance.collapseMessageWithSubject : this.$store.state.config.collapseMessageWithSubject }, + isLocal () { + if (this.status.is_local !== null) { + return this.status.is_local + } else { + const server = this.$store.state.instance.server + const windowDomain = window.location.origin + return this.status.external_url.startsWith(server) || + this.status.external_url.startsWith(windowDomain) + } + }, muteWords () { return this.$store.state.config.muteWords }, diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 1f6d0325..91792c50 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -49,7 +49,7 @@
- +