diff --git a/frontend/src/components/Notifications.tsx b/frontend/src/components/Notifications.tsx index d9daf4e..17cdeb0 100644 --- a/frontend/src/components/Notifications.tsx +++ b/frontend/src/components/Notifications.tsx @@ -102,7 +102,7 @@ export default function Notifications() { if (!testService) return; testMutation.mutate({ - service: testService, + service: testService.toLowerCase(), message: testMessage, }); }; @@ -113,7 +113,7 @@ export default function Notifications() { `Are you sure you want to delete the ${serviceName} notification service?`, ) ) { - deleteServiceMutation.mutate(serviceName); + deleteServiceMutation.mutate(serviceName.toLowerCase()); } }; diff --git a/frontend/src/routes/__root.tsx b/frontend/src/routes/__root.tsx index bf8e65a..0a8137b 100644 --- a/frontend/src/routes/__root.tsx +++ b/frontend/src/routes/__root.tsx @@ -3,29 +3,31 @@ import { useState } from "react"; import Sidebar from "../components/Sidebar"; import Header from "../components/Header"; -export const Route = createRootRoute({ - component: () => { - const [sidebarOpen, setSidebarOpen] = useState(false); +function RootLayout() { + const [sidebarOpen, setSidebarOpen] = useState(false); - return ( -
- + return ( +
+ - {/* Mobile overlay */} - {sidebarOpen && ( -
setSidebarOpen(false)} - /> - )} + {/* Mobile overlay */} + {sidebarOpen && ( +
setSidebarOpen(false)} + /> + )} -
-
-
- -
-
+
+
+
+ +
- ); - }, +
+ ); +} + +export const Route = createRootRoute({ + component: RootLayout, }); diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 71267d6..46ea75c 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -4,8 +4,5 @@ import { TanStackRouterVite } from "@tanstack/router-vite-plugin"; // https://vite.dev/config/ export default defineConfig({ - plugins: [ - TanStackRouterVite(), - react(), - ], + plugins: [TanStackRouterVite(), react()], }); diff --git a/leggend/api/routes/notifications.py b/leggend/api/routes/notifications.py index 1c192ba..bbf48b7 100644 --- a/leggend/api/routes/notifications.py +++ b/leggend/api/routes/notifications.py @@ -36,14 +36,11 @@ async def get_notification_settings() -> APIResponse: if discord_config.get("webhook") else None, telegram=TelegramConfig( - token="***" - if (telegram_config.get("token") or telegram_config.get("api-key")) - else "", - chat_id=telegram_config.get("chat_id") - or telegram_config.get("chat-id", 0), + token="***" if telegram_config.get("api-key") else "", + chat_id=telegram_config.get("chat-id", 0), enabled=telegram_config.get("enabled", True), ) - if (telegram_config.get("token") or telegram_config.get("api-key")) + if telegram_config.get("api-key") else None, filters=NotificationFilters( case_insensitive=filters_config.get("case-insensitive", []), @@ -79,8 +76,8 @@ async def update_notification_settings(settings: NotificationSettings) -> APIRes if settings.telegram: notifications_config["telegram"] = { - "token": settings.telegram.token, - "chat_id": settings.telegram.chat_id, + "api-key": settings.telegram.token, + "chat-id": settings.telegram.chat_id, "enabled": settings.telegram.enabled, } @@ -155,24 +152,12 @@ async def get_notification_services() -> APIResponse: "telegram": { "name": "Telegram", "enabled": bool( - ( - notifications_config.get("telegram", {}).get("token") - or notifications_config.get("telegram", {}).get("api-key") - ) - and ( - notifications_config.get("telegram", {}).get("chat_id") - or notifications_config.get("telegram", {}).get("chat-id") - ) + notifications_config.get("telegram", {}).get("api-key") + and notifications_config.get("telegram", {}).get("chat-id") ), "configured": bool( - ( - notifications_config.get("telegram", {}).get("token") - or notifications_config.get("telegram", {}).get("api-key") - ) - and ( - notifications_config.get("telegram", {}).get("chat_id") - or notifications_config.get("telegram", {}).get("chat-id") - ) + notifications_config.get("telegram", {}).get("api-key") + and notifications_config.get("telegram", {}).get("chat-id") ), "active": notifications_config.get("telegram", {}).get("enabled", True), }, diff --git a/leggend/services/notification_service.py b/leggend/services/notification_service.py index 3d97cd8..30ec502 100644 --- a/leggend/services/notification_service.py +++ b/leggend/services/notification_service.py @@ -109,9 +109,8 @@ class NotificationService: """Check if Telegram notifications are enabled""" telegram_config = self.notifications_config.get("telegram", {}) return bool( - telegram_config.get("token") - or telegram_config.get("api-key") - and (telegram_config.get("chat_id") or telegram_config.get("chat-id")) + telegram_config.get("api-key") + and telegram_config.get("chat-id") and telegram_config.get("enabled", True) ) @@ -174,10 +173,8 @@ class NotificationService: ctx.obj = { "notifications": { "telegram": { - "api-key": telegram_config.get("token") - or telegram_config.get("api-key"), - "chat-id": telegram_config.get("chat_id") - or telegram_config.get("chat-id"), + "api-key": telegram_config.get("api-key"), + "chat-id": telegram_config.get("chat-id"), } } }