fix: extract notification utility functions for better code organization and reuse in NotificationsPage and NotificationCenter

This commit is contained in:
Usman Baig
2026-02-16 20:46:36 +01:00
parent 56b99dfcef
commit 3b9f33b838
4 changed files with 35 additions and 47 deletions

View File

@@ -281,17 +281,17 @@ export default function OrganizationSettings() {
}, [currentOrgId])
useEffect(() => {
if (activeTab === 'notifications' && currentOrgId) {
if (activeTab === 'notifications' && currentOrgId && user?.role !== 'member') {
loadNotificationSettings()
}
}, [activeTab, currentOrgId, loadNotificationSettings])
}, [activeTab, currentOrgId, loadNotificationSettings, user?.role])
// * Redirect members away from Notifications tab (owners/admins only)
useEffect(() => {
if (activeTab === 'notifications' && user?.role === 'member') {
handleTabChange('general')
}
}, [activeTab, user?.role])
}, [activeTab, user?.role, handleTabChange])
// If no org ID, we are in personal organization context, so don't show org settings
if (!currentOrgId) {