Merge branch 'bugfix_translate' into develop
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import {
|
||||
useWindow,
|
||||
} from "@logics_common";
|
||||
|
||||
import {
|
||||
KeyEventController,
|
||||
StartPythonController,
|
||||
@@ -23,9 +19,10 @@ import { UpdatingComponent } from "./updating_component/UpdatingComponent";
|
||||
import { ModalController } from "./modal_controller/ModalController";
|
||||
import { SnackbarController } from "./snackbar_controller/SnackbarController";
|
||||
import styles from "./App.module.scss";
|
||||
import { useIsBackendReady, useIsSoftwareUpdating } from "@logics_common";
|
||||
import { useIsBackendReady, useIsSoftwareUpdating, useIsVrctAvailable, useWindow } from "@logics_common";
|
||||
|
||||
export const App = () => {
|
||||
const { currentIsVrctAvailable } = useIsVrctAvailable();
|
||||
const { currentIsBackendReady } = useIsBackendReady();
|
||||
const { WindowGeometryController } = useWindow();
|
||||
const { i18n } = useTranslation();
|
||||
@@ -42,10 +39,12 @@ export const App = () => {
|
||||
<TransparencyController />
|
||||
<WindowGeometryController />
|
||||
|
||||
{currentIsBackendReady.data === false
|
||||
? <SplashComponent />
|
||||
: <Contents key={i18n.language}/>
|
||||
{(currentIsBackendReady.data === false || currentIsVrctAvailable.data === false)
|
||||
? <SplashComponent />
|
||||
: <Contents key={i18n.language}/>
|
||||
}
|
||||
|
||||
<SnackbarController />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -61,7 +60,6 @@ const Contents = () => {
|
||||
<ConfigPage />
|
||||
<MainPage />
|
||||
<ModalController />
|
||||
<SnackbarController />
|
||||
</div>
|
||||
:
|
||||
<UpdatingComponent />
|
||||
|
||||
@@ -17,17 +17,23 @@ export const SnackbarController = () => {
|
||||
[styles.is_error]: currentNotificationStatus.data.status === "error",
|
||||
});
|
||||
|
||||
const settings = currentNotificationStatus.data;
|
||||
|
||||
let hide_duration = 5000;
|
||||
if (settings.options?.hide_duration === null) hide_duration = null;
|
||||
if (Number(settings.options?.hide_duration)) hide_duration = settings.options.hide_duration;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Snackbar
|
||||
open={currentNotificationStatus.data.is_open}
|
||||
open={settings.is_open}
|
||||
onClose={handleClose}
|
||||
TransitionComponent={SlideTransition}
|
||||
key={currentNotificationStatus.data.key}
|
||||
autoHideDuration={5000}
|
||||
key={settings.key}
|
||||
autoHideDuration={hide_duration}
|
||||
>
|
||||
<div className={snackbar_classname}>
|
||||
<p className={styles.snackbar_message}>{currentNotificationStatus.data.message}</p>
|
||||
<p className={styles.snackbar_message}>{settings.message}</p>
|
||||
</div>
|
||||
</Snackbar>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user