frontend: desperate attempt to fix fullpage issues when switching views

Signed-off-by: Nicolas Froger <nicolas@kektus.xyz>
This commit is contained in:
Nicolas Froger 2024-07-25 19:26:20 +02:00
commit b115ee3d5e
No known key found for this signature in database
2 changed files with 65 additions and 25 deletions

View file

@ -15,13 +15,15 @@ export const usePostsStore = defineStore('posts', () => {
.then((response) => {
return response.json()
})
.then((data) => {
.then(async (data) => {
posts.value = data.sort((a, b) => b.id - a.id) // highest ID (more recent) first
for (const post of posts.value) {
const postDate = new Date(post.date)
post.formatedDate = formatRelative(postDate, new Date(), { locale: fr })
post.formatedDescription = marked.parse(post.description)
}
return posts.value
})
.catch((error) => {
console.log('post list parsing failed with error: ' + error)