Skip to content

Commit b883851

Browse files
BA-hotfix: remove listener
1 parent 04ed4f0 commit b883851

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

packages/authentication/CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @baseapp-frontend/authentication
22

3+
## 4.0.5
4+
5+
### Patch Changes
6+
7+
- Remove `useEffect` hook that queues the logout listener.
8+
39
## 4.0.4
410

511
### Patch Changes
@@ -8,7 +14,6 @@
814
- Fix `useLogin` adding optional chaining to a problematic expression.
915
- Move `InitialProfileProviderForTesting` around.
1016

11-
1217
## 4.0.3
1318

1419
### Patch Changes

packages/authentication/modules/profile/useCurrentProfile/index.ts

-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
'use client'
22

3-
import { useCallback, useEffect } from 'react'
4-
53
import {
64
LOGOUT_EVENT,
75
ServerSideRenderingOption,
@@ -65,15 +63,6 @@ const useCurrentProfile = ({ noSSR = true }: ServerSideRenderingOption = {}) =>
6563
}
6664
}
6765

68-
const removeCurrentProfile = useCallback(() => setCurrentProfile(null), [])
69-
70-
useEffect(() => {
71-
eventEmitter.on(LOGOUT_EVENT, removeCurrentProfile)
72-
return () => {
73-
eventEmitter.off(LOGOUT_EVENT, removeCurrentProfile)
74-
}
75-
}, [])
76-
7766
if (isSSR) {
7867
return {
7968
currentProfile: getProfileFromCookie({ noSSR }),

packages/authentication/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@baseapp-frontend/authentication",
33
"description": "Authentication modules.",
4-
"version": "4.0.4",
4+
"version": "4.0.5",
55
"main": "./index.ts",
66
"types": "dist/index.d.ts",
77
"sideEffects": false,

packages/components/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @baseapp-frontend/components
22

3+
## 0.0.26
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- @baseapp-frontend/authentication@4.0.5
9+
310
## 0.0.25
411

512
### Patch Changes

packages/components/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@baseapp-frontend/components",
33
"description": "BaseApp components modules such as comments, notifications, messages, and more.",
4-
"version": "0.0.25",
4+
"version": "0.0.26",
55
"main": "./index.ts",
66
"types": "dist/index.d.ts",
77
"sideEffects": false,

0 commit comments

Comments
 (0)