diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/frontend/tubo/channel/views.cljs | 7 | ||||
-rw-r--r-- | src/frontend/tubo/comments/events.cljs | 1 | ||||
-rw-r--r-- | src/frontend/tubo/comments/views.cljs | 4 | ||||
-rw-r--r-- | src/frontend/tubo/components/items.cljs | 4 |
4 files changed, 9 insertions, 7 deletions
diff --git a/src/frontend/tubo/channel/views.cljs b/src/frontend/tubo/channel/views.cljs index d99923d..6994318 100644 --- a/src/frontend/tubo/channel/views.cljs +++ b/src/frontend/tubo/channel/views.cljs @@ -17,7 +17,7 @@ service-color @(rf/subscribe [:service-color]) scrolled-to-bottom? @(rf/subscribe [:scrolled-to-bottom]) page-loading? @(rf/subscribe [:show-page-loading])] - (when scrolled-to-bottom? + (when (and next-page-url scrolled-to-bottom?) (rf/dispatch [:channel/fetch-paginated url next-page-url])) [:<> (when-not page-loading? @@ -42,6 +42,7 @@ {:label "Add to playlist" :icon [:i.fa-solid.fa-plus] :on-click #(rf/dispatch [:modals/open [modals/add-to-bookmark related-streams]])}]])] - [layout/show-more-container @!show-description? description - #(reset! !show-description? (not @!show-description?))] + (when-not (empty? description) + [layout/show-more-container @!show-description? description + #(reset! !show-description? (not @!show-description?))]) [items/related-streams related-streams next-page-url]]])))) diff --git a/src/frontend/tubo/comments/events.cljs b/src/frontend/tubo/comments/events.cljs index ab79997..1d78af3 100644 --- a/src/frontend/tubo/comments/events.cljs +++ b/src/frontend/tubo/comments/events.cljs @@ -49,6 +49,7 @@ :comments/fetch-paginated (fn [{:keys [db]} [_ url next-page-url]] (if (empty? next-page-url) + {:db (assoc db :show-pagination-loading false)} {:db (assoc db :show-pagination-loading true) :fx [[:dispatch [:comments/fetch url [:comments/load-paginated] [:bad-response] diff --git a/src/frontend/tubo/comments/views.cljs b/src/frontend/tubo/comments/views.cljs index e9a08a3..746b4eb 100644 --- a/src/frontend/tubo/comments/views.cljs +++ b/src/frontend/tubo/comments/views.cljs @@ -73,9 +73,9 @@ ^{:key i} [comment-item (assoc reply :author-name uploader-name :author-avatar uploader-avatar)])])])] (when (:url next-page) (if pagination-loading? - (layout/loading-icon service-color) + [layout/loading-icon service-color] [:div.flex.justify-center - [layout/secondary-button + [layout/primary-button "Show more comments" #(rf/dispatch [:comments/fetch-paginated url (:url next-page)]) [:i.fa-solid.fa-plus]]]))])) diff --git a/src/frontend/tubo/components/items.cljs b/src/frontend/tubo/components/items.cljs index 22fd432..8a63cd0 100644 --- a/src/frontend/tubo/components/items.cljs +++ b/src/frontend/tubo/components/items.cljs @@ -109,5 +109,5 @@ {:class "xs:grid-cols-[repeat(auto-fill,_minmax(165px,_1fr))]"} (for [[i item] (map-indexed vector related-streams)] ^{:key i} [generic-item item bookmarks])]) - (when-not (empty? next-page-url) - [layout/loading-icon service-color [:text-2xl (when-not pagination-loading? :invisible)]])])) + (when (and pagination-loading? (not (empty? next-page-url))) + [layout/loading-icon service-color :text-md])])) |