Minor fixes for frontend on shuffle with no internet
This commit is contained in:
@@ -463,7 +463,7 @@ const App = (message, props) => {
|
||||
|
||||
<Route
|
||||
exact
|
||||
path="/AdminSetup"
|
||||
path="/adminsetup"
|
||||
element={
|
||||
<AdminSetup
|
||||
isLoaded={isLoaded}
|
||||
|
||||
@@ -68,13 +68,19 @@ const AdminAccount = (props) => {
|
||||
.then((response) =>
|
||||
response.json().then((responseJson) => {
|
||||
if (responseJson["success"] === false) {
|
||||
setLoginInfo(responseJson["reason"]);
|
||||
setLoginInfo(responseJson["reason"])
|
||||
|
||||
if (responseJson?.reason?.toLowerCase().includes("connection refused")) {
|
||||
navigate("/loginsetup")
|
||||
}
|
||||
|
||||
} else {
|
||||
if (responseJson.reason === "redirect") {
|
||||
setTimeout(() => {
|
||||
window.location.pathname = "/login";
|
||||
window.location.pathname = "/login"
|
||||
}, 2500)
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
)
|
||||
@@ -111,7 +117,7 @@ const AdminAccount = (props) => {
|
||||
if (responseJson["success"] === false) {
|
||||
setLoginInfo(responseJson["reason"]);
|
||||
} else {
|
||||
setLoginInfo("Successful register :)");
|
||||
setLoginInfo("Successful register! Redirecting in a moment...");
|
||||
|
||||
setTimeout(() => {
|
||||
window.location.pathname = "/login";
|
||||
|
||||
@@ -361,7 +361,7 @@ const LoginPage = props => {
|
||||
console.log("Should login instead of register!")
|
||||
setRegister(!register)
|
||||
} else {
|
||||
console.log("Path: " + path, "Register: " + register)
|
||||
//console.log("Path: " + path, "Register: " + register)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,6 +468,11 @@ const LoginPage = props => {
|
||||
response.json().then((responseJson) => {
|
||||
if (responseJson["success"] === false) {
|
||||
setLoginInfo(responseJson["reason"]);
|
||||
|
||||
if (responseJson?.reason?.toLowerCase().includes("connection refused")) {
|
||||
navigate("/loginsetup")
|
||||
}
|
||||
|
||||
} else {
|
||||
if (responseJson.sso_url !== undefined && responseJson.sso_url !== null) {
|
||||
setSSOUrl(responseJson.sso_url);
|
||||
|
||||
@@ -85,7 +85,13 @@ const LoginDialog = (props) => {
|
||||
.then((response) =>
|
||||
response.json().then((responseJson) => {
|
||||
if (responseJson["success"] === false) {
|
||||
setLoginInfo(responseJson["reason"]);
|
||||
setLoginInfo(responseJson["reason"])
|
||||
|
||||
if (responseJson?.reason?.toLowerCase().includes("connection refused")) {
|
||||
setLoginViewLoading(true)
|
||||
start()
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (responseJson.sso_url !== undefined && responseJson.sso_url !== null) {
|
||||
|
||||
Reference in New Issue
Block a user