Changed from Alert to Toast to work well with mui v18

This commit is contained in:
Frikky
2023-08-17 03:16:43 +02:00
parent 1461d6ad6b
commit 99d1a96c63
36 changed files with 553 additions and 542 deletions
+5 -4
View File
@@ -7,7 +7,8 @@ import {
Button,
} from "@mui/material";
import theme from '../theme.jsx';
import { useAlert } from "react-alert";
//import { useAlert
import { ToastContainer, toast } from "react-toastify"
import AuthenticationOauth2 from "../components/Oauth2Auth.jsx";
import AuthenticationWindow from "../components/AuthenticationWindow.jsx";
@@ -22,7 +23,7 @@ const SetAuthentication = (props) => {
const [appAuthentication, setAppAuthentication] = React.useState([]);
const isCloud = window.location.host === "localhost:3002" || window.location.host === "shuffler.io";
const alert = useAlert();
//const alert = useAlert();
const parseIncomingOpenapiData = (data) => {
if (data.app === undefined || data.app === null) {
@@ -84,7 +85,7 @@ const SetAuthentication = (props) => {
})
.then((responseJson) => {
if (responseJson.success === false || responseJson.success === undefined) {
alert.error("Failed to get the app. Does it exist?")
toast("Failed to get the app. Does it exist?")
setIsAppLoaded(true)
return;
}
@@ -92,7 +93,7 @@ const SetAuthentication = (props) => {
parseIncomingOpenapiData(responseJson);
})
.catch((error) => {
alert.error("Error in app fetch: " + error.toString());
toast("Error in app fetch: " + error.toString());
});
};