[Update] Add network error notification.
This commit is contained in:
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,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user