From 1772be044c97bbb3b060f5b5bf93e7146b600814 Mon Sep 17 00:00:00 2001 From: Ilya Y <75578537+ilya-bkv@users.noreply.github.com> Date: Wed, 15 Nov 2023 20:52:05 +0300 Subject: [PATCH] notification seen fix (#319) Co-authored-by: Igor Lobanov --- package-lock.json | 16 ++++++++-------- package.json | 4 ++-- src/context/notifications.tsx | 2 ++ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 91e064fa..b1e5a7ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -86,7 +86,7 @@ "eslint-plugin-sonarjs": "0.23.0", "eslint-plugin-unicorn": "49.0.0", "fast-deep-equal": "3.1.3", - "graphql": "16.6.0", + "graphql": "16.8.1", "graphql-tag": "2.12.6", "husky": "8.0.3", "hygen": "6.2.11", @@ -120,7 +120,7 @@ "typescript": "5.2.2", "typograf": "7.1.0", "uniqolor": "1.1.0", - "vike": "0.4.145", + "vike": "0.4.146", "vite": "4.5.0", "vite-plugin-mkcert": "1.16.0", "vite-plugin-sass-dts": "1.3.11", @@ -10070,9 +10070,9 @@ "dev": true }, "node_modules/graphql": { - "version": "16.6.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.6.0.tgz", - "integrity": "sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==", + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", + "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" @@ -18596,9 +18596,9 @@ } }, "node_modules/vike": { - "version": "0.4.145", - "resolved": "https://registry.npmjs.org/vike/-/vike-0.4.145.tgz", - "integrity": "sha512-FPYM69bRC4ilzP2lLEzXxpa8Q3lxNKUtp1h6LaFh+lROzhf9e88TTXEnZTQi7iBUsiJqBjxm+fXUGkz6BOccnw==", + "version": "0.4.146", + "resolved": "https://registry.npmjs.org/vike/-/vike-0.4.146.tgz", + "integrity": "sha512-1vaktcDy/eitSzVaUppKJWu+6vfwxKC4kV6uzAqj3RIK+WgteH3vF6IMZ0jnjjzCpeDRCIByN8PF4c0CtzRfHA==", "dev": true, "dependencies": { "@brillout/import": "0.2.3", diff --git a/package.json b/package.json index d02dbb60..3ce3e90e 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "eslint-plugin-sonarjs": "0.23.0", "eslint-plugin-unicorn": "49.0.0", "fast-deep-equal": "3.1.3", - "graphql": "16.6.0", + "graphql": "16.8.1", "graphql-tag": "2.12.6", "husky": "8.0.3", "hygen": "6.2.11", @@ -141,7 +141,7 @@ "typescript": "5.2.2", "typograf": "7.1.0", "uniqolor": "1.1.0", - "vike": "0.4.145", + "vike": "0.4.146", "vite": "4.5.0", "vite-plugin-mkcert": "1.16.0", "vite-plugin-sass-dts": "1.3.11", diff --git a/src/context/notifications.tsx b/src/context/notifications.tsx index 1a96ed94..1a53ba49 100644 --- a/src/context/notifications.tsx +++ b/src/context/notifications.tsx @@ -81,6 +81,8 @@ export const NotificationsProvider = (props: { children: JSX.Element }) => { const markNotificationAsRead = async (notification: Notification) => { await apiClient.markNotificationAsRead(notification.id) + setNotificationEntities(notification.id, 'seen', true) + setUnreadNotificationsCount((oldCount) => oldCount - 1) } const markAllNotificationsAsRead = async () => { await apiClient.markAllNotificationsAsRead()