From 24850ca6bb9e6bee9d98252755c8509e2d7043be Mon Sep 17 00:00:00 2001 From: PhotoNomad0 Date: Wed, 28 Aug 2024 08:05:04 -0400 Subject: [PATCH 1/2] reduce logging for save errors - only log file contents on fail after retry. --- package.json | 2 +- src/hooks/useScripture.tsx | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ac473f3..3ef3579 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "single-scripture-rcl", "description": "A React Component Library for Rendering a Single Scripture Resource.", - "version": "3.4.23", + "version": "3.4.24-beta", "repository": { "type": "git", "url": "https://github.com/unfoldingWord/single-scripture-rcl.git" diff --git a/src/hooks/useScripture.tsx b/src/hooks/useScripture.tsx index 58d2164..6496c21 100644 --- a/src/hooks/useScripture.tsx +++ b/src/hooks/useScripture.tsx @@ -287,7 +287,14 @@ export function useScripture({ // hook for fetching scripture fetchCount: _fetchCount, fetched: false, ignoreSha, - resourceState: { loadingResource: true }, + resourceState: { + loadingResource: true, + // reset states before fetch + contentNotFoundError: false, + scriptureNotLoadedError: false, + manifestNotFoundError: false, + invalidManifestError: false, + }, }) const response = await fetchBibleBookCore(fetchParams) From 6aeaffb7abef385bb2c9d4f2624c70fccd666d4d Mon Sep 17 00:00:00 2001 From: PhotoNomad0 Date: Wed, 28 Aug 2024 08:05:04 -0400 Subject: [PATCH 2/2] clear errors before fetch --- package.json | 2 +- src/hooks/useScripture.tsx | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ac473f3..3ef3579 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "single-scripture-rcl", "description": "A React Component Library for Rendering a Single Scripture Resource.", - "version": "3.4.23", + "version": "3.4.24-beta", "repository": { "type": "git", "url": "https://github.com/unfoldingWord/single-scripture-rcl.git" diff --git a/src/hooks/useScripture.tsx b/src/hooks/useScripture.tsx index 58d2164..6496c21 100644 --- a/src/hooks/useScripture.tsx +++ b/src/hooks/useScripture.tsx @@ -287,7 +287,14 @@ export function useScripture({ // hook for fetching scripture fetchCount: _fetchCount, fetched: false, ignoreSha, - resourceState: { loadingResource: true }, + resourceState: { + loadingResource: true, + // reset states before fetch + contentNotFoundError: false, + scriptureNotLoadedError: false, + manifestNotFoundError: false, + invalidManifestError: false, + }, }) const response = await fetchBibleBookCore(fetchParams)