Skip to content

Commit

Permalink
Merge pull request #186 from SpeciesFileGroup/development
Browse files Browse the repository at this point in the history
Fix taxon name display in footer in SSR
  • Loading branch information
jlpereira authored Nov 2, 2023
2 parents cbbce5b + e352b05 commit 36fd50c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/components/Layout/LayoutFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
<div class="container mx-auto text-sm pt-2 pb-4">
<div class="pt-4 pb-2 break-words">
{{ project_authors }}
<span v-html="store.nextAuthor" />
<span
v-if="store.nextAuthor"
v-html="store.nextAuthor"
/>
{{ project_citation }}.
<ClientOnly>
<span>Retrieved on {{ currentDate }}</span>
Expand Down
4 changes: 4 additions & 0 deletions src/modules/otus/views/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ import {
} from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useOtuStore } from '../store/store'
import { useFooterStore } from '@/store'
import { useHead } from 'unhead'
import { useSchemaOrg, defineTaxon } from '@/plugins/schemaOrg/composables'
import { RESPONSE_ERROR } from '../constants'
Expand All @@ -99,6 +100,7 @@ const router = useRouter()
const routeParams = ref(route.params)
const childrenRoutes = useChildrenRoutes()
const store = useOtuStore()
const footerStore = useFooterStore()
let controller = new AbortController()
router.afterEach((route) => {
Expand Down Expand Up @@ -137,10 +139,12 @@ onMounted(async () => {
onBeforeUnmount(() => {
store.$reset()
footerStore.$reset()
})
async function loadInitialData() {
store.$reset()
footerStore.$reset()
try {
await store.loadInit({
Expand Down
11 changes: 5 additions & 6 deletions src/store/useFooterStore.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { defineStore } from 'pinia'

export const useFooterStore = defineStore('footerStore', {
state: () => {
return {
nextAuthor: ''
}
},
state: () => ({
nextAuthor: ''
}),

actions: {
setNextAuthorText(value) {
async setNextAuthorText(value) {
this.nextAuthor = value
}
}
Expand Down

0 comments on commit 36fd50c

Please sign in to comment.