From 20faa017fd5ccbc7b915952a47f095fbb52f32a8 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sat, 24 Aug 2024 19:01:39 -0400 Subject: [PATCH] Fix bug where channel view infinitely tries to load a `Topic` channel --- CHANGELOG.md | 4 +++- .../src/components/ContentNode/ChannelContentNode.bs | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d83df3e0..0a2f9be8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing worth mentioning yet. +### Fixed + +- A bug where channel view infinitely tries to load a `Topic` channel ## [0.25.4] - 2024-08-24 diff --git a/playlet-lib/src/components/ContentNode/ChannelContentNode.bs b/playlet-lib/src/components/ContentNode/ChannelContentNode.bs index 92ad069d..7f9e9a3e 100644 --- a/playlet-lib/src/components/ContentNode/ChannelContentNode.bs +++ b/playlet-lib/src/components/ContentNode/ChannelContentNode.bs @@ -7,13 +7,13 @@ import "pkg:/source/utils/Locale.bs" import "pkg:/source/utils/Logging.bs" function LoadChannel(invidiousNode as object) as void - if m.contentTask <> invalid - m.contentTask.cancel = true + loadState = m.top.loadState + if loadState = FeedLoadState.Loading or loadState = FeedLoadState.Loaded or loadState = FeedLoadState.Error + return end if - loadState = m.top.loadState - if loadState = FeedLoadState.Loading or loadState = FeedLoadState.Loaded - return + if m.contentTask <> invalid + m.contentTask.cancel = true end if m.top.loadState = FeedLoadState.Loading