Skip to content

Commit

Permalink
🐛 Fix onboarding links
Browse files Browse the repository at this point in the history
  • Loading branch information
BetaHuhn committed Aug 21, 2021
1 parent 146ec1b commit 61839d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions client/pages/welcome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ export default {
demoLink: { id: 'demo', url: 'https://github.com ', crate: undefined, meta: { description: 'GitHub is where over 65 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and feat...', icon: 'https://github.githubassets.com/favicons/favicon.svg', image: 'https://github.githubassets.com/images/modules/site/social-cards/github-social.png', title: 'GitHub: Where the world builds software' }, redirect: { enabled: false }, addedWith: 'web', addedAt: '2021-07-19T17:34:25.671Z' }
}
},
async fetch() {
this.$store.dispatch('GET_CRATES')
const links = await this.$api.getRecentLinks()
this.$store.commit('SET_CURRENT_CRATE_LINKS', links)
},
head() {
return {
title: 'Welcome | WebCrate',
Expand All @@ -155,15 +161,10 @@ export default {
return (this.$store.state.crates || []).slice(0, 6)
},
links() {
if (!this.$store.state.currentCrateLinks) return []
return (this.$store.state.currentCrateLinks || []).slice(0, 6)
}
},
async created() {
this.$store.dispatch('GET_CRATES')
const links = await this.$api.getRecentLinks()
this.$store.commit('SET_CURRENT_CRATE_LINKS', links)
},
methods: {
showAddCrateModal() {
this.$modal.replace('addCrate', { changePageOnSuccess: false })
Expand Down
2 changes: 1 addition & 1 deletion server/middleware/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function sendResponse(_req: express.Request, res: express.Response, next:
status: 200,
message: 'ok',
...(data && data.last && { last: data.last }),
...(data && data.count && data.items ? { data: data.items } : { data })
...(data && data.count !== undefined && data.items !== undefined ? { data: data.items } : { data })
})
}

Expand Down

0 comments on commit 61839d1

Please sign in to comment.