Skip to content

Commit

Permalink
Merge pull request #226 from ymaheshwari1/preorder/#225
Browse files Browse the repository at this point in the history
Fixed: listing data not visible when listingTime information is missing(#225)
  • Loading branch information
ravilodhi authored Sep 13, 2023
2 parents b95d196 + a8e5f9b commit 082d59c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/views/catalog-product-details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1059,24 +1059,27 @@ export default defineComponent({
status: metafieldValue.status,
promiseDate: metafieldValue["promise_date"]
}
const listingTime = DateTime.fromFormat(listData.listingTime, "MMM dd,yyyy HH:mm:ss").toLocaleString(DateTime.DATETIME_MED);
let listingTime = ''
if(listData.listingTime) {
listingTime = DateTime.fromFormat(listData.listingTime, "MMM dd,yyyy HH:mm:ss").toLocaleString(DateTime.DATETIME_MED);
}
if (!listData.containsError) {
if (listData.status === 'inactive') {
// showing the job's runTime as listing time
listData.listingTimeAndStatus = this.$t("Delisted at", { listingTime })
// showing the job's runTime as listing time, and not showing listing time if not present
listingTime && (listData.listingTimeAndStatus = this.$t("Delisted at", { listingTime }))
listData.listingStatus = 'Not listed'
} else {
listData.listingTimeAndStatus = this.$t("Listed at", { listingTime })
listingTime && (listData.listingTimeAndStatus = this.$t("Listed at", { listingTime }))
listData.listingStatus = 'Listed'
}
} else {
// If it failed to update, considered the status must old
if (listData.status === 'inactive') {
// showing the job's runTime as listing time
listData.listingTimeAndStatus = this.$t("Delisting failed at", { listingTime })
listingTime && (listData.listingTimeAndStatus = this.$t("Delisting failed at", { listingTime }))
listData.listingStatus = 'Listed'
} else {
listData.listingTimeAndStatus = this.$t("Listing failed at", { listingTime })
listingTime && (listData.listingTimeAndStatus = this.$t("Listing failed at", { listingTime }))
listData.listingStatus = 'Not listed'
}
}
Expand Down

0 comments on commit 082d59c

Please sign in to comment.