mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2024-11-22 16:17:29 +00:00
Fix IGTV loading and post count
This commit is contained in:
parent
f94de3b0a4
commit
5f036124d9
@ -29,9 +29,16 @@ class Timeline {
|
|||||||
this.type = type
|
this.type = type
|
||||||
/** @type {import("./TimelineEntry")[][]} */
|
/** @type {import("./TimelineEntry")[][]} */
|
||||||
this.pages = []
|
this.pages = []
|
||||||
|
this.entryCount = 0
|
||||||
|
if (this.type === "timeline") {
|
||||||
if (this.user.data.edge_owner_to_timeline_media) {
|
if (this.user.data.edge_owner_to_timeline_media) {
|
||||||
this.addPage(this.user.data.edge_owner_to_timeline_media)
|
this.addPage(this.user.data.edge_owner_to_timeline_media)
|
||||||
}
|
}
|
||||||
|
} else if (this.type === "igtv") {
|
||||||
|
if (this.user.data.edge_felix_video_timeline) {
|
||||||
|
this.addPage(this.user.data.edge_felix_video_timeline)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hasNextPage() {
|
hasNextPage() {
|
||||||
@ -75,8 +82,13 @@ class Timeline {
|
|||||||
// add the page
|
// add the page
|
||||||
this.pages.push(transformEdges(page.edges))
|
this.pages.push(transformEdges(page.edges))
|
||||||
this.page_info = page.page_info
|
this.page_info = page.page_info
|
||||||
|
// update self post count
|
||||||
|
this.entryCount = page.count
|
||||||
|
// update user post count
|
||||||
|
if (this.type === "timeline") {
|
||||||
this.user.posts = page.count
|
this.user.posts = page.count
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async fetchFeed() {
|
async fetchFeed() {
|
||||||
const setup = getFeedSetup(this.user.data.username, this.user.data.biography, constants.website_origin+this.user.proxyProfilePicture, new Date(this.user.cachedAt))
|
const setup = getFeedSetup(this.user.data.username, this.user.data.biography, constants.website_origin+this.user.proxyProfilePicture, new Date(this.user.cachedAt))
|
||||||
|
@ -71,9 +71,9 @@ html
|
|||||||
if userURL
|
if userURL
|
||||||
p.website
|
p.website
|
||||||
a(href=userURL)= userURL
|
a(href=userURL)= userURL
|
||||||
if user.posts != undefined
|
if selectedTimeline.entryCount != undefined
|
||||||
div.profile-counter
|
div.profile-counter
|
||||||
| #[span(data-numberformat=user.posts).count #{numberFormat(user.posts)} ]
|
| #[span(data-numberformat=selectedTimeline.entryCount).count #{numberFormat(selectedTimeline.entryCount)} ]
|
||||||
= ll.post_counter_label
|
= ll.post_counter_label
|
||||||
if followerCountsAvailable
|
if followerCountsAvailable
|
||||||
if user.following != undefined
|
if user.following != undefined
|
||||||
@ -104,7 +104,7 @@ html
|
|||||||
.timeline-section(dir=ll.meta_direction)
|
.timeline-section(dir=ll.meta_direction)
|
||||||
.selector-container
|
.selector-container
|
||||||
+selector-button(ll.tab_timeline, "timeline", "")
|
+selector-button(ll.tab_timeline, "timeline", "")
|
||||||
if user.data.has_channel !== false
|
if user.data.has_channel !== false || user.data.edge_felix_video_timeline.count !== 0
|
||||||
+selector-button(ll.tab_igtv, "igtv", "/channel")
|
+selector-button(ll.tab_igtv, "igtv", "/channel")
|
||||||
|
|
||||||
main(class=hasPosts ? "" : "no-posts")#timeline.timeline
|
main(class=hasPosts ? "" : "no-posts")#timeline.timeline
|
||||||
|
Loading…
Reference in New Issue
Block a user