Fix joined date erroring on channels without a joined date (#3314)

This commit is contained in:
absidue 2023-03-22 13:09:41 +01:00 committed by GitHub
parent 04ccdcd37f
commit 4433a183c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -600,7 +600,7 @@ export default defineComponent({
const views = extractNumberFromString(about.views.text)
this.views = isNaN(views) ? null : views
this.joined = new Date(about.joined.text.replace('Joined').trim())
this.joined = about.joined.text !== 'N/A' ? new Date(about.joined.text.replace('Joined').trim()) : 0
this.location = about.country.text !== 'N/A' ? about.country.text : null
} catch (err) {
@ -757,7 +757,7 @@ export default defineComponent({
this.updateSubscriptionDetails({ channelThumbnailUrl: thumbnail, channelName: channelName, channelId: channelId })
this.description = autolinker.link(response.description)
this.views = response.totalViews
this.joined = new Date(response.joined * 1000)
this.joined = response.joined > 0 ? new Date(response.joined * 1000) : 0
this.relatedChannels = response.relatedChannels.map((channel) => {
const thumbnailUrl = channel.authorThumbnails.at(-1).url
return {