fix: Fixed tests
feat: Added RClone integration feat: Implemented plugin settings feat: Updated minimal store version test: Fixed tests feat: Moved store and igdb and es-de to their own plugins
This commit is contained in:
parent
444d8c4c27
commit
c09fbd3dc8
115 changed files with 4139 additions and 1502 deletions
|
|
@ -1,12 +1,16 @@
|
|||
import { useEffect, useState } from "react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { SystemInfoContext } from "../scripts/contexts";
|
||||
import { systemApi } from "../scripts/clientApi";
|
||||
import { SystemInfoType } from "@/shared/constants";
|
||||
import LoadingScreen from "./LoadingScreen";
|
||||
|
||||
export default function AppCommunication (data: { children: any; })
|
||||
{
|
||||
|
||||
const [systemInfo, setSystemInfo] = useState<SystemInfoType | undefined>();
|
||||
const [loadingInfo, setLoadingInfo] = useState<string | undefined>(undefined);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const loadingProgressBarRef = useRef<HTMLProgressElement>(null);
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
const sub = systemApi.api.system.info.system.subscribe();
|
||||
|
|
@ -20,14 +24,32 @@ export default function AppCommunication (data: { children: any; })
|
|||
case "focus":
|
||||
window.focus();
|
||||
break;
|
||||
case "loading":
|
||||
setLoadingInfo(data.state);
|
||||
if (loadingProgressBarRef.current)
|
||||
loadingProgressBarRef.current.value = data.progress;
|
||||
setLoading(true);
|
||||
break;
|
||||
case "loaded":
|
||||
setLoading(false);
|
||||
break;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
document.documentElement.dataset.loaded = "true";
|
||||
}, []);
|
||||
|
||||
return <SystemInfoContext value={systemInfo}>
|
||||
{data.children}
|
||||
{loading ?
|
||||
<LoadingScreen>
|
||||
<div className="flex flex-col items-center gap-4">
|
||||
<div className="flex gap-2">
|
||||
<span className="loading loading-spinner loading-xl"></span>
|
||||
{loadingInfo}
|
||||
</div>
|
||||
<progress ref={loadingProgressBarRef} className="progress w-[20vw]" value={0} max="100"></progress>
|
||||
</div>
|
||||
</LoadingScreen>
|
||||
: data.children}
|
||||
</SystemInfoContext>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue