Compare commits

...

1 Commits

Author SHA1 Message Date
Henry Jameson 710856ef99 emulating is_local for mastoapi 2019-03-09 18:52:23 +02:00
3 changed files with 12 additions and 2 deletions

View File

@ -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
},

View File

@ -49,7 +49,7 @@
<div class="button-icon visibility-icon" v-if="status.visibility">
<i :class="visibilityIcon(status.visibility)" :title="status.visibility | capitalize"></i>
</div>
<a :href="status.external_url" target="_blank" v-if="!status.is_local && !isPreview" class="source_url" title="Source">
<a :href="status.external_url" target="_blank" v-if="!isLocal && !isPreview" class="source_url" title="Source">
<i class="button-icon icon-link-ext-alt"></i>
</a>
<template v-if="expandable && !isPreview">

View File

@ -180,7 +180,7 @@ export const parseStatus = (data) => {
output.external_url = data.url
// FIXME missing!!
output.is_local = false
output.is_local = null
} else {
output.favorited = data.favorited
output.fave_num = data.fave_num