Show current username in HTML page title
This commit is contained in:
parent
b80ff7297e
commit
46369a261e
3 changed files with 14 additions and 1 deletions
|
@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Show current username in HTML page title.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Remove invisible characters from display names.
|
- Remove invisible characters from display names.
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
<title>Mitra</title>
|
<title>Mitra | Federated social network</title>
|
||||||
<meta name="description" content="Federated social network">
|
<meta name="description" content="Federated social network">
|
||||||
<meta name="application-name" content="mitra-web v<%= process.env.VUE_APP_VERSION %>">
|
<meta name="application-name" content="mitra-web v<%= process.env.VUE_APP_VERSION %>">
|
||||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
|
|
|
@ -3,14 +3,23 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { watch } from "vue"
|
||||||
|
import { $, $$ } from "vue/macros"
|
||||||
import { useRoute } from "vue-router"
|
import { useRoute } from "vue-router"
|
||||||
|
|
||||||
import { useInstanceInfo } from "@/store/instance"
|
import { useInstanceInfo } from "@/store/instance"
|
||||||
|
import { useCurrentUser } from "@/store/user"
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
const { currentUser } = $(useCurrentUser())
|
||||||
const { loadInstanceInfo } = useInstanceInfo()
|
const { loadInstanceInfo } = useInstanceInfo()
|
||||||
|
|
||||||
loadInstanceInfo()
|
loadInstanceInfo()
|
||||||
|
|
||||||
|
watch($$(currentUser), () => {
|
||||||
|
const title = currentUser ? `@${currentUser.username}` : "Federated social network"
|
||||||
|
document.title = `Mitra | ${title}`
|
||||||
|
}, { immediate: true })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
Loading…
Reference in a new issue