Improve the inventory page 3

This commit is contained in:
Urtzi Alfaro
2025-09-18 08:06:32 +02:00
parent dcb3ce441b
commit ae77a0e1c5
31 changed files with 2376 additions and 1774 deletions

View File

@@ -59,21 +59,6 @@ export const AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {
initializeAuth();
}, []);
// Set up token refresh interval
useEffect(() => {
if (authStore.isAuthenticated && authStore.token) {
const refreshInterval = setInterval(() => {
if (authStore.refreshToken) {
authStore.refreshAuth().catch(() => {
// Refresh failed, logout user
authStore.logout();
});
}
}, 14 * 60 * 1000); // Refresh every 14 minutes
return () => clearInterval(refreshInterval);
}
}, [authStore.isAuthenticated, authStore.token, authStore.refreshToken]);
const contextValue: AuthContextType = {
user: authStore.user,