Refactor code structure for improved readability and maintainability

This commit is contained in:
2025-08-01 19:43:11 +02:00
parent 8341e50dc8
commit 11e6e1684c
9 changed files with 22 additions and 9 deletions
+12 -1
View File
@@ -4,5 +4,16 @@ import { myToast } from "./toastify";
export const changeAPIcookie = (newApiKey: string) => {
let apiKey15 = newApiKey.slice(0, 15);
Cookies.set("apiKey", newApiKey);
myToast("API key updated successfully!" + " " + "Your new API key: " + apiKey15 + "...", "success");
if (Cookies.get("apiKey") === newApiKey) {
myToast(
"API key updated successfully!" +
" " +
"Your new API key: " +
apiKey15 +
"...",
"success"
);
} else {
myToast("Failed to update API key. (Error: x30)", "error");
}
};