fix null error in profile (#506)

This commit is contained in:
Nolan Lawson 2018-08-27 19:32:30 -07:00 committed by GitHub
parent 8334598786
commit 46fa65f25a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,8 +37,8 @@ export default {
followRequested: ({ relationship }) => relationship && relationship.requested, followRequested: ({ relationship }) => relationship && relationship.requested,
accountId: ({ account }) => account && account.id, accountId: ({ account }) => account && account.id,
acct: ({ account }) => account.acct, acct: ({ account }) => account.acct,
muting: ({ relationship }) => relationship.muting, muting: ({ relationship }) => relationship && relationship.muting,
blocking: ({ relationship }) => relationship.blocking, blocking: ({ relationship }) => relationship && relationship.blocking,
followLabel: ({ following, followRequested, account, acct }) => { followLabel: ({ following, followRequested, account, acct }) => {
if (typeof following === 'undefined' || !account) { if (typeof following === 'undefined' || !account) {
return '' return ''
@ -62,14 +62,14 @@ export default {
// //
// end copypasta (StatusOptionsDialog.html / AccountProfileOptionsDialog.html) // end copypasta (StatusOptionsDialog.html / AccountProfileOptionsDialog.html)
// //
showingReblogs: ({ relationship }) => !!relationship.showing_reblogs, showingReblogs: ({ relationship }) => relationship ? relationship.showing_reblogs : true,
showReblogsLabel: ({ showingReblogs, acct }) => ( showReblogsLabel: ({ showingReblogs, acct }) => (
showingReblogs showingReblogs
? `Hide boosts from @${acct}` ? `Hide boosts from @${acct}`
: `Show boosts from @${acct}` : `Show boosts from @${acct}`
), ),
domain: ({ acct }) => acct.split('@')[1], domain: ({ acct }) => acct.split('@')[1],
blockingDomain: ({ relationship }) => !!relationship.domain_blocking, blockingDomain: ({ relationship }) => relationship && relationship.domain_blocking,
blockDomainLabel: ({ blockingDomain, domain }) => ( blockDomainLabel: ({ blockingDomain, domain }) => (
blockingDomain blockingDomain
? `Unhide ${domain}` ? `Unhide ${domain}`