Skip to content

Commit

Permalink
chore(meta): store reactivity
Browse files Browse the repository at this point in the history
  • Loading branch information
molimauro committed Apr 15, 2022
1 parent ad03b1a commit b20668a
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion components/compositions/useMeta.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const useMeta = () => {
const { $store } = useNuxtApp()
const title = computed(() => $store.state.meta.title)

useHead({
title: $store.state.meta.title,
title,
})
}

Expand Down
2 changes: 1 addition & 1 deletion layouts/chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export default Vue.extend({
mixins: [Touch, Layout],
middleware: ['authenticated'],
setup() {
const meta = useMeta()
useMeta()
},
data() {
return {
Expand Down
2 changes: 1 addition & 1 deletion layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import useMeta from '~/components/compositions/useMeta'
export default Vue.extend({
setup() {
const meta = useMeta()
useMeta()
},
})
</script>
Expand Down
2 changes: 1 addition & 1 deletion layouts/files.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default Vue.extend({
mixins: [Touch, Layout],
middleware: 'authenticated',
setup() {
const meta = useMeta()
useMeta()
},
data() {
return {
Expand Down
2 changes: 1 addition & 1 deletion layouts/friends.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default Vue.extend({
mixins: [Touch, Layout],
middleware: 'authenticated',
setup() {
const meta = useMeta()
useMeta()
},
data() {
return {
Expand Down
2 changes: 1 addition & 1 deletion layouts/server.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default Vue.extend({
mixins: [Touch, Layout],
middleware: 'authenticated',
setup() {
const meta = useMeta()
useMeta()
},
data() {
return {
Expand Down
2 changes: 1 addition & 1 deletion store/meta/state.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MetaState } from './types'

const InitialMetaState = (): MetaState => ({
title: 'Satellite-Absolute',
title: 'Satellite.im',
})

export default InitialMetaState

0 comments on commit b20668a

Please sign in to comment.