From ea7fb09689964547c88eba8cfe8af9f6ef43b329 Mon Sep 17 00:00:00 2001 From: Roland Date: Tue, 4 Jan 2022 09:26:21 -0700 Subject: [PATCH] Fixing bug where videos were not fetched on a channel page. --- app/src/components/Videos.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/components/Videos.js b/app/src/components/Videos.js index 37130129..1a191ec4 100644 --- a/app/src/components/Videos.js +++ b/app/src/components/Videos.js @@ -252,6 +252,8 @@ class Videos extends React.Component { await this.fetchChannel(); } else if (pageChanged) { this.applyStateToHistory(); + // TODO this causes a double search request. This will be fixed with a custom hook. + await this.fetchVideos(); } } @@ -304,6 +306,7 @@ class Videos extends React.Component { } async fetchVideos() { + this.setState({videos: null}); let offset = this.state.limit * this.state.activePage - this.state.limit; let channel_link = this.state.channel ? this.state.channel.link : null; let {queryStr, searchOrder, limit} = this.state;