From bbf596b6cbbcd64e8c54e82a39083bf4d28c1c1e Mon Sep 17 00:00:00 2001 From: Surajyadav Date: Sat, 11 Jan 2025 22:39:24 +0530 Subject: [PATCH] lints Signed-off-by: Surajyadav --- .../dark-mode-toggle-button.tsx | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/ui/src/app/applications/components/pod-logs-viewer/dark-mode-toggle-button.tsx b/ui/src/app/applications/components/pod-logs-viewer/dark-mode-toggle-button.tsx index fa651c27a9c88..59aba01fd1807 100644 --- a/ui/src/app/applications/components/pod-logs-viewer/dark-mode-toggle-button.tsx +++ b/ui/src/app/applications/components/pod-logs-viewer/dark-mode-toggle-button.tsx @@ -9,7 +9,7 @@ export const DarkModeToggleButton = ({prefs}: {prefs: ViewPreferences}) => { React.useEffect(() => { // Only run when theme changes or LogViewerTheme is not initialized const profile = prefs.appDetails.UseDarkModeInLogViewerForAppTheme; - + if (!profile) { // First time initialization services.viewPreferences.updatePreferences({ @@ -17,8 +17,8 @@ export const DarkModeToggleButton = ({prefs}: {prefs: ViewPreferences}) => { appDetails: { ...prefs.appDetails, UseDarkModeInLogViewerForAppTheme: { - light: prefs.appDetails.darkMode, - dark: prefs.appDetails.darkMode + light: prefs.appDetails.darkMode, + dark: prefs.appDetails.darkMode } } }); @@ -27,7 +27,7 @@ export const DarkModeToggleButton = ({prefs}: {prefs: ViewPreferences}) => { // Update darkMode based on saved preference for current theme const currentThemeDarkMode = profile[prefs.theme as keyof typeof profile]; - if (prefs.appDetails.darkMode !==currentThemeDarkMode) { + if (prefs.appDetails.darkMode !== currentThemeDarkMode) { services.viewPreferences.updatePreferences({ ...prefs, appDetails: { @@ -58,12 +58,5 @@ export const DarkModeToggleButton = ({prefs}: {prefs: ViewPreferences}) => { }); }; - return ( - - ); -}; \ No newline at end of file + return ; +};