notification seen fix (#319)

Co-authored-by: Igor Lobanov <igor.lobanov@onetwotrip.com>
This commit is contained in:
Ilya Y 2023-11-15 20:52:05 +03:00 committed by GitHub
parent 8b114ea75f
commit 1772be044c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 10 deletions

16
package-lock.json generated
View File

@ -86,7 +86,7 @@
"eslint-plugin-sonarjs": "0.23.0", "eslint-plugin-sonarjs": "0.23.0",
"eslint-plugin-unicorn": "49.0.0", "eslint-plugin-unicorn": "49.0.0",
"fast-deep-equal": "3.1.3", "fast-deep-equal": "3.1.3",
"graphql": "16.6.0", "graphql": "16.8.1",
"graphql-tag": "2.12.6", "graphql-tag": "2.12.6",
"husky": "8.0.3", "husky": "8.0.3",
"hygen": "6.2.11", "hygen": "6.2.11",
@ -120,7 +120,7 @@
"typescript": "5.2.2", "typescript": "5.2.2",
"typograf": "7.1.0", "typograf": "7.1.0",
"uniqolor": "1.1.0", "uniqolor": "1.1.0",
"vike": "0.4.145", "vike": "0.4.146",
"vite": "4.5.0", "vite": "4.5.0",
"vite-plugin-mkcert": "1.16.0", "vite-plugin-mkcert": "1.16.0",
"vite-plugin-sass-dts": "1.3.11", "vite-plugin-sass-dts": "1.3.11",
@ -10070,9 +10070,9 @@
"dev": true "dev": true
}, },
"node_modules/graphql": { "node_modules/graphql": {
"version": "16.6.0", "version": "16.8.1",
"resolved": "https://registry.npmjs.org/graphql/-/graphql-16.6.0.tgz", "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz",
"integrity": "sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==", "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0"
@ -18596,9 +18596,9 @@
} }
}, },
"node_modules/vike": { "node_modules/vike": {
"version": "0.4.145", "version": "0.4.146",
"resolved": "https://registry.npmjs.org/vike/-/vike-0.4.145.tgz", "resolved": "https://registry.npmjs.org/vike/-/vike-0.4.146.tgz",
"integrity": "sha512-FPYM69bRC4ilzP2lLEzXxpa8Q3lxNKUtp1h6LaFh+lROzhf9e88TTXEnZTQi7iBUsiJqBjxm+fXUGkz6BOccnw==", "integrity": "sha512-1vaktcDy/eitSzVaUppKJWu+6vfwxKC4kV6uzAqj3RIK+WgteH3vF6IMZ0jnjjzCpeDRCIByN8PF4c0CtzRfHA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@brillout/import": "0.2.3", "@brillout/import": "0.2.3",

View File

@ -107,7 +107,7 @@
"eslint-plugin-sonarjs": "0.23.0", "eslint-plugin-sonarjs": "0.23.0",
"eslint-plugin-unicorn": "49.0.0", "eslint-plugin-unicorn": "49.0.0",
"fast-deep-equal": "3.1.3", "fast-deep-equal": "3.1.3",
"graphql": "16.6.0", "graphql": "16.8.1",
"graphql-tag": "2.12.6", "graphql-tag": "2.12.6",
"husky": "8.0.3", "husky": "8.0.3",
"hygen": "6.2.11", "hygen": "6.2.11",
@ -141,7 +141,7 @@
"typescript": "5.2.2", "typescript": "5.2.2",
"typograf": "7.1.0", "typograf": "7.1.0",
"uniqolor": "1.1.0", "uniqolor": "1.1.0",
"vike": "0.4.145", "vike": "0.4.146",
"vite": "4.5.0", "vite": "4.5.0",
"vite-plugin-mkcert": "1.16.0", "vite-plugin-mkcert": "1.16.0",
"vite-plugin-sass-dts": "1.3.11", "vite-plugin-sass-dts": "1.3.11",

View File

@ -81,6 +81,8 @@ export const NotificationsProvider = (props: { children: JSX.Element }) => {
const markNotificationAsRead = async (notification: Notification) => { const markNotificationAsRead = async (notification: Notification) => {
await apiClient.markNotificationAsRead(notification.id) await apiClient.markNotificationAsRead(notification.id)
setNotificationEntities(notification.id, 'seen', true)
setUnreadNotificationsCount((oldCount) => oldCount - 1)
} }
const markAllNotificationsAsRead = async () => { const markAllNotificationsAsRead = async () => {
await apiClient.markAllNotificationsAsRead() await apiClient.markAllNotificationsAsRead()