Merge branch 'bugfix_translate' of https://github.com/misyaguziya/VRCT into bugfix_translate
This commit is contained in:
@@ -10,3 +10,4 @@ export { useOpenFolder } from "./useOpenFolder";
|
||||
export { useMessage } from "./useMessage";
|
||||
export { useUpdateSoftware } from "./useUpdateSoftware";
|
||||
export { useVolume } from "./useVolume";
|
||||
export { useHandleNetworkConnection } from "./useHandleNetworkConnection";
|
||||
16
src-ui/logics/common/useHandleNetworkConnection.js
Normal file
16
src-ui/logics/common/useHandleNetworkConnection.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { useNotificationStatus } from "@logics_common";
|
||||
|
||||
export const useHandleNetworkConnection = () => {
|
||||
|
||||
const { showNotification_Error } = useNotificationStatus();
|
||||
|
||||
const handleNetworkConnection = (is_network_connected) => {
|
||||
if (!is_network_connected) {
|
||||
showNotification_Error("Network is not connected. Some of the function will not work.");
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
handleNetworkConnection,
|
||||
};
|
||||
};
|
||||
@@ -3,7 +3,7 @@ import { arrayToObject } from "@utils";
|
||||
|
||||
import {
|
||||
useNotificationStatus,
|
||||
|
||||
useHandleNetworkConnection,
|
||||
|
||||
useComputeMode,
|
||||
useInitProgress,
|
||||
@@ -178,6 +178,8 @@ export const useReceiveRoutes = () => {
|
||||
|
||||
const { showNotification_Success, showNotification_Error } = useNotificationStatus();
|
||||
|
||||
const { handleNetworkConnection } = useHandleNetworkConnection();
|
||||
|
||||
const routes = {
|
||||
// Common
|
||||
"/run/feed_watchdog": () => {},
|
||||
@@ -188,6 +190,7 @@ export const useReceiveRoutes = () => {
|
||||
"/run/open_filepath_logs": () => console.log("Opened Directory, Message Logs"),
|
||||
"/run/open_filepath_config_file": () => console.log("Opened Directory, Config File"),
|
||||
"/run/update_software_flag": updateIsSoftwareUpdateAvailable,
|
||||
"/run/connected_network": handleNetworkConnection,
|
||||
|
||||
// Main Page
|
||||
// Page Controls
|
||||
|
||||
Reference in New Issue
Block a user