fix application name (#501)

it should not show "Web" by default but should be absent if `application` is null
This commit is contained in:
Nolan Lawson 2018-08-26 19:46:19 -07:00 committed by GitHub
parent b60d636ee2
commit b59f544efb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,6 +6,7 @@
> >
<time datetime={createdAtDate} title={formattedDate}>{formattedDate}</time> <time datetime={createdAtDate} title={formattedDate}>{formattedDate}</time>
</ExternalLink> </ExternalLink>
{#if applicationName}
{#if applicationWebsite} {#if applicationWebsite}
<ExternalLink className="status-application" <ExternalLink className="status-application"
href={applicationWebsite} href={applicationWebsite}
@ -20,6 +21,7 @@
{applicationName} {applicationName}
</span> </span>
{/if} {/if}
{/if}
<a class="status-favs-reblogs status-reblogs" <a class="status-favs-reblogs status-reblogs"
href="/statuses/{originalStatusId}/reblogs" href="/statuses/{originalStatusId}/reblogs"
aria-label={reblogsLabel}> aria-label={reblogsLabel}>
@ -136,7 +138,7 @@
store: () => store, store: () => store,
computed: { computed: {
application: ({ originalStatus }) => originalStatus.application, application: ({ originalStatus }) => originalStatus.application,
applicationName: ({ application }) => ((application && application.name) || 'Web'), applicationName: ({ application }) => (application && application.name),
applicationWebsite: ({ application }) => (application && application.website), applicationWebsite: ({ application }) => (application && application.website),
createdAtDate: ({ originalStatus }) => originalStatus.created_at, createdAtDate: ({ originalStatus }) => originalStatus.created_at,
numReblogs: ({ originalStatus }) => originalStatus.reblogs_count || 0, numReblogs: ({ originalStatus }) => originalStatus.reblogs_count || 0,