mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-01-11 08:24:58 +01:00
Merge pull request #139 from h3poteto/display_name
Show username if display_name is blanked
This commit is contained in:
commit
0368ccf43a
@ -5,7 +5,7 @@
|
||||
<icon name="star" scale="0.7"></icon>
|
||||
</div>
|
||||
<div class="action-detail">
|
||||
<span class="bold">{{ message.account.display_name }}</span> favourited your status
|
||||
<span class="bold">{{ username(message.account) }}</span> favourited your status
|
||||
</div>
|
||||
<div class="action-icon">
|
||||
<img :src="message.account.avatar" />
|
||||
@ -19,7 +19,7 @@
|
||||
<div class="detail">
|
||||
<div class="toot-header">
|
||||
<div class="user">
|
||||
{{ message.status.account.display_name }}
|
||||
{{ username(message.status.account) }}
|
||||
</div>
|
||||
<div class="timestamp">
|
||||
{{ parseDatetime(message.status.created_at) }}
|
||||
@ -40,6 +40,13 @@ export default {
|
||||
name: 'favourite',
|
||||
props: ['message'],
|
||||
methods: {
|
||||
username (account) {
|
||||
if (account.display_name !== '') {
|
||||
return account.display_name
|
||||
} else {
|
||||
return account.username
|
||||
}
|
||||
},
|
||||
parseDatetime (datetime) {
|
||||
return moment(datetime).format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<icon name="user-plus" scale="0.7"></icon>
|
||||
</div>
|
||||
<div class="action-detail">
|
||||
<span class="bold">{{ message.account.display_name }}</span> is now following you
|
||||
<span class="bold">{{ username(message.account) }}</span> is now following you
|
||||
</div>
|
||||
<div class="action-icon">
|
||||
<img :src="message.account.avatar" />
|
||||
@ -19,7 +19,16 @@
|
||||
<script>
|
||||
export default {
|
||||
name: 'follow',
|
||||
props: ['message']
|
||||
props: ['message'],
|
||||
methods: {
|
||||
username (account) {
|
||||
if (account.display_name !== '') {
|
||||
return account.display_name
|
||||
} else {
|
||||
return account.username
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<icon name="retweet" scala="0.7"></icon>
|
||||
</div>
|
||||
<div class="action-detail">
|
||||
<span class="bold">{{ message.account.display_name }}</span> boosted your status
|
||||
<span class="bold">{{ username(message.account) }}</span> boosted your status
|
||||
</div>
|
||||
<div class="action-icon">
|
||||
<img :src="message.account.avatar" />
|
||||
@ -19,7 +19,7 @@
|
||||
<div class="detail">
|
||||
<div class="toot-header">
|
||||
<div class="user">
|
||||
{{ message.status.account.display_name }}
|
||||
{{ username(message.status.account) }}
|
||||
</div>
|
||||
<div class="timestamp">
|
||||
{{ parseDatetime(message.status.created_at) }}
|
||||
@ -40,6 +40,13 @@ export default {
|
||||
name: 'reblog',
|
||||
props: ['message'],
|
||||
methods: {
|
||||
username (account) {
|
||||
if (account.display_name !== '') {
|
||||
return account.display_name
|
||||
} else {
|
||||
return account.username
|
||||
}
|
||||
},
|
||||
parseDatetime (datetime) {
|
||||
return moment(datetime).format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
<div class="detail">
|
||||
<div class="toot-header">
|
||||
<div class="user">
|
||||
{{ originalMessage(message).account.display_name }}
|
||||
{{ username(originalMessage(message).account) }}
|
||||
</div>
|
||||
<div class="timestamp">
|
||||
{{ parseDatetime(message.created_at) }}
|
||||
@ -24,7 +24,7 @@
|
||||
<img :src="message.account.avatar" />
|
||||
</span>
|
||||
<span class="reblogger-name">
|
||||
{{ message.account.display_name }}
|
||||
{{ username(message.account) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="tool-box">
|
||||
@ -59,6 +59,13 @@ export default {
|
||||
return message
|
||||
}
|
||||
},
|
||||
username (account) {
|
||||
if (account.display_name !== '') {
|
||||
return account.display_name
|
||||
} else {
|
||||
return account.username
|
||||
}
|
||||
},
|
||||
parseDatetime (datetime) {
|
||||
return moment(datetime).format('YYYY-MM-DD HH:mm:ss')
|
||||
},
|
||||
|
@ -214,11 +214,11 @@ function buildNotification (notification) {
|
||||
switch (notification.type) {
|
||||
case 'favourite':
|
||||
return new Notification('Favourite', {
|
||||
body: `${notification.account.display_name} favourited your status`
|
||||
body: `${username(notification.account)} favourited your status`
|
||||
})
|
||||
case 'follow':
|
||||
return new Notification('Follow', {
|
||||
body: `${notification.account.display_name} is now following you`
|
||||
body: `${username(notification.account)} is now following you`
|
||||
})
|
||||
case 'mention':
|
||||
return new Notification(`${notification.status.account.display_name}`, {
|
||||
@ -226,7 +226,15 @@ function buildNotification (notification) {
|
||||
})
|
||||
case 'reblog':
|
||||
return new Notification('Reblog', {
|
||||
body: `${notification.account.display_name} boosted your status`
|
||||
body: `${username(notification.account)} boosted your status`
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function username (account) {
|
||||
if (account.display_name !== '') {
|
||||
return account.display_name
|
||||
} else {
|
||||
return account.username
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user