2018-11-13 03:28:43 +01:00
|
|
|
<svelte:head>
|
2018-12-30 23:51:03 +01:00
|
|
|
<title>{notificationsIndicator}{instanceIndicator} · {name}</title>
|
2018-11-13 03:28:43 +01:00
|
|
|
</svelte:head>
|
|
|
|
<script>
|
|
|
|
import { store } from '../_store/store'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data: () => ({
|
|
|
|
settingsPage: false
|
|
|
|
}),
|
|
|
|
store: () => store,
|
|
|
|
computed: {
|
|
|
|
instanceIndicator: ({ $isUserLoggedIn, $currentInstance, settingsPage }) => (
|
|
|
|
// If the user is not logged in, or if they're on a settings page (which
|
|
|
|
// is more general than instance-specific), of if this is server-rendered, then
|
|
|
|
// show "Pinafore". Otherwise show the instance name.
|
|
|
|
`${($isUserLoggedIn && !settingsPage && $currentInstance) ? $currentInstance : 'Pinafore'}`
|
|
|
|
),
|
|
|
|
notificationsIndicator: ({ $hasNotifications, $numberOfNotifications }) => (
|
2018-12-30 23:51:03 +01:00
|
|
|
$hasNotifications ? `(${$numberOfNotifications}) ` : ''
|
2018-11-13 03:28:43 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2018-12-30 23:51:03 +01:00
|
|
|
</script>
|