[Update] Starting Up: Add loading animation when the software preparing, until backend is ready.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
export { useIsBackendReady } from "./useIsBackendReady";
|
||||
export { useWindow } from "./useWindow";
|
||||
export { useIsOpenedConfigPage } from "./useIsOpenedConfigPage";
|
||||
export { useIsSoftwareUpdateAvailable } from "./useIsSoftwareUpdateAvailable";
|
||||
|
||||
15
src-ui/logics/common/useIsBackendReady.js
Normal file
15
src-ui/logics/common/useIsBackendReady.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { useStore_IsBackendReady } from "@store";
|
||||
|
||||
export const useIsBackendReady = () => {
|
||||
const { currentIsBackendReady, updateIsBackendReady } = useStore_IsBackendReady();
|
||||
|
||||
const setIsBackendReady = (is_ready) => {
|
||||
updateIsBackendReady(is_ready);
|
||||
};
|
||||
|
||||
return {
|
||||
currentIsBackendReady,
|
||||
setIsBackendReady,
|
||||
updateIsBackendReady,
|
||||
};
|
||||
};
|
||||
@@ -2,6 +2,7 @@ import { translator_status } from "@ui_configs";
|
||||
import { arrayToObject } from "@utils";
|
||||
|
||||
import {
|
||||
useIsBackendReady,
|
||||
useWindow,
|
||||
useMessage,
|
||||
useVolume,
|
||||
@@ -61,6 +62,7 @@ import {
|
||||
} from "@logics_configs";
|
||||
|
||||
export const useReceiveRoutes = () => {
|
||||
const { updateIsBackendReady } = useIsBackendReady();
|
||||
const { restoreWindowGeometry } = useWindow();
|
||||
const { updateIsMainPageCompactMode } = useIsMainPageCompactMode();
|
||||
const {
|
||||
@@ -438,6 +440,7 @@ export const useReceiveRoutes = () => {
|
||||
case 200:
|
||||
if (parsed_data.endpoint === "/run/initialization_complete") {
|
||||
initDataSyncProcess(parsed_data.result);
|
||||
updateIsBackendReady(true);
|
||||
break;
|
||||
};
|
||||
const route = routes[parsed_data.endpoint];
|
||||
|
||||
Reference in New Issue
Block a user