Skip to content

Commit d7a2405

Browse files
committed
fix issue in nomadlist fetch to actually show 'Unknown' if there is no location or next destination
1 parent 49e7cdd commit d7a2405

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_data/nomadlist.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ module.exports = async function () {
55
try {
66
const { data } = await axios.get(`${url}?format=json`)
77

8-
data.location.now.string = data.location.now.city === null ? 'Unknown' : `${data.location.now.city}, ${data.location.now.country}`
9-
data.location.next.string = data.location.next.city === null ? 'Unknown' : `${data.location.next.city}, ${data.location.next.country}`
8+
data.location.now.string = !data.location.now.city ? 'Unknown' : `${data.location.now.city}, ${data.location.now.country}`
9+
data.location.next.string = !data.location.next.city ? 'Unknown' : `${data.location.next.city}, ${data.location.next.country}`
1010

1111
const returnValue = {
1212
data,

0 commit comments

Comments
 (0)