Sort company tabs alphabetically on projects page

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Krao Hasanee
2026-05-13 12:07:47 -04:00
parent a519e806e5
commit 54ceb69dd0
+1 -1
View File
@@ -115,7 +115,7 @@ export default function MyProjects() {
const [submissions, setSubmissions] = useState([]);
const [loading, setLoading] = useState(true);
const [filter, setFilter] = useState('all'); // 'all' | 'mine'
const companies = currentUser.companies?.length ? currentUser.companies : (currentUser.company ? [currentUser.company] : []);
const companies = (currentUser.companies?.length ? currentUser.companies : (currentUser.company ? [currentUser.company] : [])).slice().sort((a, b) => a.name.localeCompare(b.name));
const [activeCompanyId, setActiveCompanyId] = useState(() => companies[0]?.id || null);
useEffect(() => {