From fc5ca9b2a11b36c4e6adb74de4deca05ab4e07e3 Mon Sep 17 00:00:00 2001 From: Alexander Borg Date: Sat, 13 Sep 2025 22:00:44 +0200 Subject: [PATCH] Fix jwt-token --- client/src/pages/Settings.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/pages/Settings.jsx b/client/src/pages/Settings.jsx index 6fa9676..bfc69c5 100644 --- a/client/src/pages/Settings.jsx +++ b/client/src/pages/Settings.jsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react'; +import React, { useState, useEffect, useMemo } from 'react'; import { useAuth } from '../contexts/AuthContext'; import api from '../services/api'; import toast from 'react-hot-toast'; @@ -64,7 +64,7 @@ const Settings = () => { } // Filter tabs based on user permissions - const availableTabs = [ + const availableTabs = useMemo(() => [ { id: 'general', name: 'General', @@ -95,7 +95,7 @@ const Settings = () => { icon: UserGroupIcon, permission: 'users.view' }, - ].filter(tab => hasPermission(user?.role, tab.permission)); + ].filter(tab => hasPermission(user?.role, tab.permission)), [user?.role]); // Set initial tab to first available tab useEffect(() => {