Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[39808] Don't try to mark read items as read again

Oliver Güntherf9d673c1ee6b
diff --git a/frontend/src/app/features/in-app-notifications/center/state/ian-center.service.ts b/frontend/src/app/features/in-app-notifications/center/state/ian-center.service.ts
index 1c1cdf88ec9..a901fac0004 100644
--- a/frontend/src/app/features/in-app-notifications/center/state/ian-center.service.ts
+++ b/frontend/src/app/features/in-app-notifications/center/state/ian-center.service.ts
@@ -40,6 +40,7 @@ import { APIV3Service } from 'core-app/core/apiv3/api-v3.service';
import { InAppNotificationsResourceService } from 'core-app/core/state/in-app-notifications/in-app-notifications.service';
import {
mapHALCollectionToIDCollection,
+ selectCollectionAsEntities$,
selectCollectionAsHrefs$,
} from 'core-app/core/state/collection-store';
import { INotificationPageQueryParameters } from 'core-app/features/in-app-notifications/in-app-notifications.routes';
@@ -134,13 +135,13 @@ export class IanCenterService extends UntilDestroyedMixin {
}
markAllAsRead():void {
- selectCollectionAsHrefs$(this.resourceService, this.query.params)
- .pipe(
- take(1),
- )
- .subscribe((collection) => {
- this.markAsRead(collection.ids);
- });
+ const ids:ID[] = selectCollectionAsEntities$(this.resourceService, this.resourceService.query.getValue(), this.query.params)
+ .filter((notification) => notification.readIAN === false)
+ .map((notification) => notification.id);
+
+ if (ids.length > 0) {
+ this.markAsRead(ids);
+ }
}
openSplitScreen(wpId:string|null):void {
diff --git a/frontend/src/app/features/in-app-notifications/center/toolbar/mark-all-as-read/mark-all-as-read-button.component.ts b/frontend/src/app/features/in-app-notifications/center/toolbar/mark-all-as-read/mark-all-as-read-button.component.ts
index b6eca373f23..c8fdaff39f3 100644
--- a/frontend/src/app/features/in-app-notifications/center/toolbar/mark-all-as-read/mark-all-as-read-button.component.ts
+++ b/frontend/src/app/features/in-app-notifications/center/toolbar/mark-all-as-read/mark-all-as-read-button.component.ts
@@ -13,7 +13,6 @@ import { IanCenterService } from 'core-app/features/in-app-notifications/center/
export class MarkAllAsReadButtonComponent {
text = {
mark_all_read: this.I18n.t('js.notifications.center.mark_all_read'),
-
};
constructor(