tutorial fixes

This commit is contained in:
PhilReact 2024-12-19 12:01:39 +02:00
parent d23aa6e0fc
commit e5db082a9b
3 changed files with 17 additions and 11 deletions

View File

@ -22,11 +22,10 @@ export const useFetchResources = () => {
let isCalling = false;
let percentLoaded = 0;
let timer = 24;
let tries = 26;
let tries = 0;
let calledFirstTime = false
const callFunction = async ()=> {
console.log('calledFirstTime', calledFirstTime)
if (isCalling) return;
isCalling = true;
@ -43,8 +42,10 @@ export const useFetchResources = () => {
},
});
res = await resCall.json()
if(tries === 5 && intervalId?.current){
clearInterval(intervalId?.current)
if(tries > 18 ){
if(intervalId?.current){
clearInterval(intervalId?.current)
}
setResources((prev) => ({
...prev,
[`${service}-${name}-${identifier}`]: {
@ -104,6 +105,7 @@ export const useFetchResources = () => {
isCalling = false;
downloadResource({ name, service, identifier }, true);
}, 25000);
return;
}
@ -122,7 +124,10 @@ export const useFetchResources = () => {
// Check if progress is 100% and clear interval if true
if (res?.status === 'READY') {
clearInterval(intervalId.current);
if(intervalId.current){
clearInterval(intervalId.current);
}
// Update Recoil state for completion
setResources((prev) => ({

View File

@ -440,7 +440,8 @@ export const VideoPlayer: React.FC<VideoPlayerProps> = ({
}
}
console.log('!src && !isLoading) || !startPlay', startPlay, resourceStatus?.status === 'READY')
console.log('resourceStatus', resourceStatus)
return (
<VideoContainer
tabIndex={0}

View File

@ -98,7 +98,7 @@ useEffect(()=> {
multi: [
{
title: "Getting Started",
title: "1. Getting Started",
resource: {
name: "a-test",
service: "VIDEO",
@ -106,7 +106,7 @@ useEffect(()=> {
},
},
{
title: "Overview",
title: "2. Overview",
resource: {
name: "a-test",
service: "VIDEO",
@ -114,7 +114,7 @@ useEffect(()=> {
},
},
{
title: "Qortal Groups",
title: "3. Qortal Groups",
resource: {
name: "a-test",
service: "VIDEO",
@ -133,7 +133,7 @@ useEffect(()=> {
setOpenTutorialModal({
multi: [
{
title: "Apps Dashboard",
title: "1. Apps Dashboard",
resource: {
name: "a-test",
service: "VIDEO",
@ -141,7 +141,7 @@ useEffect(()=> {
},
},
{
title: "Apps Navigation",
title: "2. Apps Navigation",
resource: {
name: "a-test",
service: "VIDEO",