Skip to content

Commit 593ca13

Browse files
committed
fix: reverting notifications created from previous state refactoring
1 parent 82c129f commit 593ca13

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aura",
3-
"version": "0.4.3",
3+
"version": "0.4.4",
44
"license": "GPL-3.0-or-later",
55
"type": "module",
66
"packageManager": "bun@1.2.4",

src/components/Header/DefaultHeader.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ export default function DefaultHeader({
4343
breadcrumbs?: ReactNode;
4444
} & PropsWithChildren) {
4545
const dispatch = useDispatch();
46-
const notificationsCount = useSelector(notificationsSelector).length;
46+
const notificationsCount = useSelector(notificationsSelector).filter(
47+
(item) => !item.viewed,
48+
).length;
4749

4850
return (
4951
<div className="flex flex-col gap-2.5 px-1 pt-3 md:px-4 md:pt-9">

src/store/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const persistIgnoredActions = [
7575

7676
const persistConfig = {
7777
key: 'root',
78-
version: 5,
78+
version: 6,
7979
storage: localforage,
8080
blacklist: ['recoveryData'],
8181
migrate: async (state: PersistedState, currentVersion: number) => {

src/store/migrations.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,13 @@ export const migrations: MigrationManifest = {
6565
},
6666
};
6767
},
68+
6: (oldState: any) => {
69+
return {
70+
...oldState,
71+
notifications: {
72+
...oldState.notifications,
73+
items: [],
74+
},
75+
};
76+
},
6877
};

0 commit comments

Comments
 (0)