Fix jwt-token

This commit is contained in:
2025-09-13 22:00:44 +02:00
parent 478e2fecb7
commit fc5ca9b2a1

View File

@@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect, useMemo } from 'react';
import { useAuth } from '../contexts/AuthContext'; import { useAuth } from '../contexts/AuthContext';
import api from '../services/api'; import api from '../services/api';
import toast from 'react-hot-toast'; import toast from 'react-hot-toast';
@@ -64,7 +64,7 @@ const Settings = () => {
} }
// Filter tabs based on user permissions // Filter tabs based on user permissions
const availableTabs = [ const availableTabs = useMemo(() => [
{ {
id: 'general', id: 'general',
name: 'General', name: 'General',
@@ -95,7 +95,7 @@ const Settings = () => {
icon: UserGroupIcon, icon: UserGroupIcon,
permission: 'users.view' 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 // Set initial tab to first available tab
useEffect(() => { useEffect(() => {