From 1eeaced04b5bfd598153b0d0c7de323b870cf09e Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sun, 1 Jun 2025 17:53:27 -0400 Subject: [PATCH] Fix a bug where it says "(Failed to load)" when switching profiles --- CHANGELOG.md | 6 ++++++ .../components/VideoFeed/VideoRowListRowContentTask.bs | 8 +++++--- playlet-lib/src/source/services/HttpClient.bs | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9c1c498..f6146faf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- A bug where it says "(Failed to load)" when switching profiles + ## [0.40.0] - 2025-06-01 ### Added diff --git a/playlet-lib/src/components/VideoFeed/VideoRowListRowContentTask.bs b/playlet-lib/src/components/VideoFeed/VideoRowListRowContentTask.bs index 5823f502..96cfd760 100644 --- a/playlet-lib/src/components/VideoFeed/VideoRowListRowContentTask.bs +++ b/playlet-lib/src/components/VideoFeed/VideoRowListRowContentTask.bs @@ -92,11 +92,13 @@ function VideoRowListRowContentTask(input as object) as object feedSources[feedSourcesIndex] = feedSource feedContentNode.feedSources = feedSources - if feedContentNode.title.instr(" (Failed to load)") = -1 - feedContentNode.title += " (Failed to load)" + isCancelled = response.cancelled = true + if not isCancelled + if feedContentNode.title.instr(" (Failed to load)") = -1 + feedContentNode.title += " (Failed to load)" + end if end if - isCancelled = response.cancelled = true HandleFeedLoadErrorDialog(response.error, isCancelled, rowList) continue while end if diff --git a/playlet-lib/src/source/services/HttpClient.bs b/playlet-lib/src/source/services/HttpClient.bs index f1fc0a86..9fe8a69a 100644 --- a/playlet-lib/src/source/services/HttpClient.bs +++ b/playlet-lib/src/source/services/HttpClient.bs @@ -719,10 +719,10 @@ namespace HttpClient else if m.request._sent <> true m._errorMessage = Tr(Locale.HttpClient.RequestNotSent) - else if m.IsTimedOut() - m._errorMessage = Tr(Locale.HttpClient.RequestTimedOut) else if m.IsCancelled() m._errorMessage = Tr(Locale.HttpClient.RequestCancelled) + else if m.IsTimedOut() + m._errorMessage = Tr(Locale.HttpClient.RequestTimedOut) else if type(m.event) = "roUrlEvent" m._errorMessage = `${Tr(Locale.HttpClient.Reason)}:${m.event.GetFailureReason() }\nStatusCode: ${m.StatusCode()}\nRequestId: ${m.event.GetSourceIdentity()}` if includeBody