refactor: convert config variables to upper case

This commit is contained in:
Elias Schneider
2022-12-05 16:53:52 +01:00
parent d4a0f1a4f1
commit 0499548dd3
20 changed files with 54 additions and 51 deletions

View File

@@ -17,7 +17,7 @@ const Setup = () => {
if (!user) {
router.push("/auth/signUp");
return;
} else if (config.get("setupFinished")) {
} else if (config.get("SETUP_FINISHED")) {
router.push("/");
return;
}

View File

@@ -10,7 +10,7 @@ const SignUp = () => {
const router = useRouter();
if (user) {
router.replace("/");
} else if (config.get("allowRegistration") == "false") {
} else if (config.get("ALLOW_REGISTRATION") == "false") {
router.replace("/auth/signIn");
} else {
return (

View File

@@ -74,9 +74,9 @@ export default function Home() {
const { classes } = useStyles();
const router = useRouter();
if (user || config.get("allowUnauthenticatedShares")) {
if (user || config.get("ALLOW_UNAUTHENTICATED_SHARES")) {
router.replace("/upload");
} else if (!config.get("showHomePage")) {
} else if (!config.get("SHOW_HOME_PAGE")) {
router.replace("/auth/signIn");
} else {
return (

View File

@@ -95,7 +95,7 @@ const Upload = () => {
}
}
}, [files]);
if (!user && !config.get("allowUnauthenticatedShares")) {
if (!user && !config.get("ALLOW_UNAUTHENTICATED_SHARES")) {
router.replace("/");
} else {
return (
@@ -110,10 +110,12 @@ const Upload = () => {
modals,
{
isUserSignedIn: user ? true : false,
allowUnauthenticatedShares: config.get(
"allowUnauthenticatedShares"
ALLOW_UNAUTHENTICATED_SHARES: config.get(
"ALLOW_UNAUTHENTICATED_SHARES"
),
ENABLE_EMAIL_RECIPIENTS: config.get(
"ENABLE_EMAIL_RECIPIENTS"
),
emailRecipientsEnabled: config.get("emailRecipientsEnabled"),
},
uploadFiles
)