Skip to content

Commit

Permalink
Fix urls of askstories not starting with 'Ask HN'
Browse files Browse the repository at this point in the history
  • Loading branch information
letwebdev committed Oct 8, 2023
1 parent 69d0c2e commit 5a5d235
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/views/HackerNewsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,7 @@ async function fetchLiveData(listName: string = "topstories"): Promise<LiveData>
})()
const descriptions = computed<string[]>(() => selected.value.map((option) => option.description))
function setUrl(item: Item) {
if (item.title.startsWith("Ask HN")) {
return item.discuss.toString()
}
return item.url.toString()
return item.url ? item.url.toString() : item.discuss.toString()
}
</script>
<template>
Expand Down

0 comments on commit 5a5d235

Please sign in to comment.