@@ -61,7 +61,6 @@ import {
6161import NotificationCard from '../Notification/notificationCard' ;
6262import DarkModeButton from './DarkModeButton' ;
6363import BellNotification from './BellNotification' ;
64- import { getUserProfile } from '../../actions/userProfile' ;
6564
6665export function Header ( props ) {
6766 const location = useLocation ( ) ;
@@ -216,27 +215,6 @@ export function Header(props) {
216215 const openModal = ( ) => {
217216 setLogoutPopup ( true ) ;
218217 } ;
219-
220- const handlePermissionChangeAck = async ( ) => {
221- // handle setting the ack true
222- try {
223- const { firstName : name , lastName, personalLinks, adminLinks} = props . userProfile
224- const res = await axios . put ( ENDPOINTS . USER_PROFILE ( userId ) , {
225- // req fields for updation
226- firstName : name ,
227- lastName,
228- personalLinks,
229- adminLinks,
230-
231- isAcknowledged : true ,
232- } ) ;
233- if ( res . status === 200 ) {
234- props . getUserProfile ( userId ) ;
235- }
236- } catch ( e ) {
237- // console.log('update ack', e);
238- }
239- }
240218
241219 const removeViewingUser = ( ) => {
242220 setPopup ( false ) ;
@@ -325,7 +303,6 @@ export function Header(props) {
325303
326304 if ( location . pathname === '/login' ) return null ;
327305
328- const viewingUser = JSON . parse ( window . sessionStorage . getItem ( 'viewingUser' ) )
329306 return (
330307 < div className = "header-wrapper" >
331308 < Navbar className = "py-3 navbar" color = "dark" dark expand = "md" >
@@ -578,14 +555,8 @@ export function Header(props) {
578555 </ Navbar >
579556 { ! isAuthUser && (
580557 < PopUpBar
581- message = { `You are currently viewing the header for ${ viewingUser . firstName } ${ viewingUser . lastName } ` }
582558 onClickClose = { ( ) => setPopup ( prevPopup => ! prevPopup ) }
583- />
584- ) }
585- { props . auth . isAuthenticated && props . userProfile ?. permissions ?. isAcknowledged === false && (
586- < PopUpBar
587- message = "Heads Up, there were permission changes made to this account"
588- onClickClose = { handlePermissionChangeAck }
559+ viewingUser = { JSON . parse ( window . sessionStorage . getItem ( 'viewingUser' ) ) }
589560 />
590561 ) }
591562 < div >
@@ -637,5 +608,4 @@ export default connect(mapStateToProps, {
637608 getAllRoles,
638609 hasPermission,
639610 getWeeklySummaries,
640- getUserProfile
641611} ) ( Header ) ;
0 commit comments