diff --git a/backend/src/index.js b/backend/src/index.js index ece918c..f704000 100644 --- a/backend/src/index.js +++ b/backend/src/index.js @@ -105,13 +105,13 @@ pool.connect() let timeInterval = 60 * 1000; if (config.environment === 'prod') { - console.log('Setting up scheduled tasks for production environment, 2 mins'); - timeInterval = 2 * 60 * 1000; + console.log('Setting up scheduled tasks for production environment, 10 mins'); + timeInterval = 10 * 60 * 1000; }else { console.log('Setting up scheduled tasks for development environment, 2 mins'); timeInterval = 2 * 60 * 1000; } - // Process stock notifications every 30 minutes + // Process stock notifications every X minutes setInterval(async () => { try { console.log('Processing low stock notifications...'); diff --git a/frontend/src/features/ui/uiSlice.js b/frontend/src/features/ui/uiSlice.js index 4e49a7b..41cf296 100644 --- a/frontend/src/features/ui/uiSlice.js +++ b/frontend/src/features/ui/uiSlice.js @@ -2,10 +2,9 @@ import { createSlice } from '@reduxjs/toolkit'; const initialState = { notifications: [], - darkMode: localStorage.getItem('darkMode') === 'true', + darkMode: !(localStorage.getItem('lightMode') === 'true'), mobileMenuOpen: false, }; - export const uiSlice = createSlice({ name: 'ui', initialState, @@ -26,11 +25,11 @@ export const uiSlice = createSlice({ }, toggleDarkMode: (state) => { state.darkMode = !state.darkMode; - localStorage.setItem('darkMode', state.darkMode); + localStorage.setItem('lightMode', state.darkMode); }, setDarkMode: (state, action) => { state.darkMode = action.payload; - localStorage.setItem('darkMode', action.payload); + localStorage.setItem('lightMode', action.payload); }, toggleMobileMenu: (state) => { state.mobileMenuOpen = !state.mobileMenuOpen;