Minor fixes for frontend on shuffle with no internet

This commit is contained in:
Frikky
2025-05-20 18:48:52 +02:00
parent c2c4a9c323
commit 065f6f9332
4 changed files with 23 additions and 6 deletions
+1 -1
View File
@@ -463,7 +463,7 @@ const App = (message, props) => {
<Route
exact
path="/AdminSetup"
path="/adminsetup"
element={
<AdminSetup
isLoaded={isLoaded}
+9 -3
View File
@@ -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";
+6 -1
View File
@@ -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);
+7 -1
View File
@@ -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) {