frontend: desperate attempt to fix fullpage issues when switching views
Signed-off-by: Nicolas Froger <nicolas@kektus.xyz>
This commit is contained in:
parent
4e848fe952
commit
b115ee3d5e
2 changed files with 65 additions and 25 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue