#511: Resolve "Page title not updated when changing the language"
This commit is contained in:
parent
33190613a2
commit
ed1fdc85c1
|
@ -0,0 +1 @@
|
||||||
|
i18n: Update page title when changing the App's language. (#511)
|
|
@ -57,18 +57,7 @@ Vue.use(GetTextPlugin, {
|
||||||
Vue.use(VueMasonryPlugin)
|
Vue.use(VueMasonryPlugin)
|
||||||
Vue.use(VueLazyload)
|
Vue.use(VueLazyload)
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
Vue.directive('title', {
|
Vue.directive('title', function (el, binding) {
|
||||||
inserted: (el, binding) => {
|
|
||||||
let parts = []
|
|
||||||
let instanceName = store.state.instance.settings.instance.name.value
|
|
||||||
if (instanceName.length === 0) {
|
|
||||||
instanceName = 'Funkwhale'
|
|
||||||
}
|
|
||||||
parts.unshift(instanceName)
|
|
||||||
parts.unshift(binding.value)
|
|
||||||
document.title = parts.join(' - ')
|
|
||||||
},
|
|
||||||
updated: (el, binding) => {
|
|
||||||
let parts = []
|
let parts = []
|
||||||
let instanceName = store.state.instance.settings.instance.name.value
|
let instanceName = store.state.instance.settings.instance.name.value
|
||||||
if (instanceName.length === 0) {
|
if (instanceName.length === 0) {
|
||||||
|
@ -78,7 +67,7 @@ Vue.directive('title', {
|
||||||
parts.unshift(binding.value)
|
parts.unshift(binding.value)
|
||||||
document.title = parts.join(' - ')
|
document.title = parts.join(' - ')
|
||||||
}
|
}
|
||||||
})
|
)
|
||||||
axios.interceptors.request.use(function (config) {
|
axios.interceptors.request.use(function (config) {
|
||||||
// Do something before request is sent
|
// Do something before request is sent
|
||||||
if (store.state.auth.token) {
|
if (store.state.auth.token) {
|
||||||
|
|
Loading…
Reference in New Issue