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

[#45912] Erroneous behavior on Notification center page when there are +99 notifications and we mark all as read

Eric Schubertfadeea0637ba
diff --git a/frontend/src/app/core/apiv3/endpoints/notifications/apiv3-notifications-paths.ts b/frontend/src/app/core/apiv3/endpoints/notifications/apiv3-notifications-paths.ts
index 42008fe509c..a49f4c2a925 100644
--- a/frontend/src/app/core/apiv3/endpoints/notifications/apiv3-notifications-paths.ts
+++ b/frontend/src/app/core/apiv3/endpoints/notifications/apiv3-notifications-paths.ts
@@ -26,27 +26,30 @@
// See COPYRIGHT and LICENSE files for more details.
//++
+import { Observable } from 'rxjs';
+import { HttpClient } from '@angular/common/http';
+import { ID } from '@datorama/akita';
+
import { ApiV3ResourceCollection } from 'core-app/core/apiv3/paths/apiv3-resource';
import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
-import { Observable } from 'rxjs';
import {
- ApiV3ListParameters,
ApiV3ListFilter,
+ ApiV3ListParameters,
listParamsString,
} from 'core-app/core/apiv3/paths/apiv3-list-resource.interface';
import { ApiV3NotificationPaths } from 'core-app/core/apiv3/endpoints/notifications/apiv3-notification-paths';
import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
-import { HttpClient } from '@angular/common/http';
import { IHALCollection } from 'core-app/core/apiv3/types/hal-collection.type';
-import { ID } from '@datorama/akita';
import { INotification } from 'core-app/core/state/in-app-notifications/in-app-notification.model';
export class ApiV3NotificationsPaths
extends ApiV3ResourceCollection<INotification, ApiV3NotificationPaths> {
@InjectField() http:HttpClient;
- constructor(protected apiRoot:ApiV3Service,
- protected basePath:string) {
+ constructor(
+ protected apiRoot:ApiV3Service,
+ protected basePath:string,
+ ) {
super(apiRoot, basePath, 'notifications', ApiV3NotificationPaths);
}
@@ -92,7 +95,7 @@ export class ApiV3NotificationsPaths
* Mark all notifications as read
* @param ids
*/
- public markRead(ids:Array<ID>):Observable<unknown> {
+ public markAsReadByIds(ids:Array<ID>):Observable<unknown> {
return this
.http
.post(
@@ -104,4 +107,15 @@ export class ApiV3NotificationsPaths
},
);
}
+
+ public markAsReadByFilter(filters:ApiV3ListFilter[]):Observable<unknown> {
+ return this.http.post(
+ `${this.path}/read_ian${(listParamsString({ filters: filters.map((f) => [f[0], f[1], f[2]]) }))}`,
+ {},
+ {
+ withCredentials: true,
+ responseType: 'json',
+ },
+ );
+ }
}
diff --git a/frontend/src/app/core/state/in-app-notifications/in-app-notifications.actions.ts b/frontend/src/app/core/state/in-app-notifications/in-app-notifications.actions.ts
index 237e60ef24a..e63397832ea 100644
--- a/frontend/src/app/core/state/in-app-notifications/in-app-notifications.actions.ts
+++ b/frontend/src/app/core/state/in-app-notifications/in-app-notifications.actions.ts
@@ -1,17 +1,52 @@
+// -- copyright
+// OpenProject is an open source project management software.
+// Copyright (C) 2012-2023 the OpenProject GmbH
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License version 3.
+//
+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+// Copyright (C) 2006-2013 Jean-Philippe Lang
+// Copyright (C) 2010-2013 the ChiliProject Team
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+// See COPYRIGHT and LICENSE files for more details.
+//++
+
import { ID } from '@datorama/akita';
import {
action,
props,
} from 'ts-action';
+import { ApiV3ListFilter } from 'core-app/core/apiv3/paths/apiv3-list-resource.interface';
+
export const markNotificationsAsRead = action(
'[IAN] Mark notifications as read',
props<{ origin:string, notifications:ID[] }>(),
);
+export const markNotificationsAsReadByFilters = action(
+ '[IAN] Mark notifications as read by filter',
+ props<{ origin:string, filters:ApiV3ListFilter[] }>(),
+);
+
export const notificationsMarkedRead = action(
'[IAN] Notifications were marked as read',
- props<{ origin:string, notifications:ID[] }>(),
+ props<{ origin:string, notifications:ID[], all:boolean }>(),
);
export const notificationCountIncreased = action(
diff --git a/frontend/src/app/core/state/in-app-notifications/in-app-notifications.service.ts b/frontend/src/app/core/state/in-app-notifications/in-app-notifications.service.ts
index a78f7ba0758..ee914bcd37e 100644
--- a/frontend/src/app/core/state/in-app-notifications/in-app-notifications.service.ts
+++ b/frontend/src/app/core/state/in-app-notifications/in-app-notifications.service.ts
@@ -1,15 +1,45 @@
+// -- copyright
+// OpenProject is an open source project management software.
+// Copyright (C) 2012-2023 the OpenProject GmbH
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License version 3.
+//
+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+// Copyright (C) 2006-2013 Jean-Philippe Lang
+// Copyright (C) 2010-2013 the ChiliProject Team
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+// See COPYRIGHT and LICENSE files for more details.
+//++
+
import { Injectable } from '@angular/core';
import { tap } from 'rxjs/operators';
import { Observable } from 'rxjs';
import { ID } from '@datorama/akita';
+
import {
markNotificationsAsRead,
+ markNotificationsAsReadByFilters,
notificationsMarkedRead,
} from 'core-app/core/state/in-app-notifications/in-app-notifications.actions';
import { EffectCallback, EffectHandler } from 'core-app/core/state/effects/effect-handler.decorator';
import { ActionsService } from 'core-app/core/state/actions/actions.service';
-import { InAppNotificationsStore } from './in-app-notifications.store';
-import { INotification } from './in-app-notification.model';
+import { INotification } from 'core-app/core/state/in-app-notifications/in-app-notification.model';
+import { InAppNotificationsStore } from 'core-app/core/state/in-app-notifications/in-app-notifications.store';
import { CollectionStore, ResourceCollectionService } from 'core-app/core/state/resource-collection.service';
import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
@@ -26,7 +56,7 @@ export class InAppNotificationsResourceService extends ResourceCollectionService
return this
.apiV3Service
.notifications
- .markRead(notifications)
+ .markAsReadByIds(notifications)
.pipe(
tap(() => {
this.store.update(notifications, { readIAN: true });
@@ -42,10 +72,21 @@ export class InAppNotificationsResourceService extends ResourceCollectionService
this
.markAsRead(action.notifications)
.subscribe(() => (
- this.actions$.dispatch(notificationsMarkedRead(action))
+ this.actions$.dispatch(notificationsMarkedRead({ ...action, all: false }))
));
}
+ @EffectCallback(markNotificationsAsReadByFilters)
+ private markNotificationsAsReadByFilters(action:ReturnType<typeof markNotificationsAsReadByFilters>) {
+ return this
+ .apiV3Service
+ .notifications
+ .markAsReadByFilter(action.filters)
+ .subscribe(() => {
+ this.actions$.dispatch(notificationsMarkedRead({ origin: action.origin, notifications: [], all: true }));
+ });
+ }
+
protected createStore():CollectionStore<INotification> {
return new InAppNotificationsStore();
}
diff --git a/frontend/src/app/features/in-app-notifications/bell/state/ian-bell.service.ts b/frontend/src/app/features/in-app-notifications/bell/state/ian-bell.service.ts
index b86d55793b6..1eb9d076cc4 100644
--- a/frontend/src/app/features/in-app-notifications/bell/state/ian-bell.service.ts
+++ b/frontend/src/app/features/in-app-notifications/bell/state/ian-bell.service.ts
@@ -1,29 +1,52 @@
+// -- copyright
+// OpenProject is an open source project management software.
+// Copyright (C) 2012-2023 the OpenProject GmbH
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License version 3.
+//
+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+// Copyright (C) 2006-2013 Jean-Philippe Lang
+// Copyright (C) 2010-2013 the ChiliProject Team
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+// See COPYRIGHT and LICENSE files for more details.
+//++
+
import { Injectable } from '@angular/core';
-import { IanBellStore } from './ian-bell.store';
-import {
- InAppNotificationsResourceService,
-} from 'core-app/core/state/in-app-notifications/in-app-notifications.service';
-import { IAN_FACET_FILTERS } from 'core-app/features/in-app-notifications/center/state/ian-center.store';
import {
+ catchError,
map,
- tap,
skip,
- catchError,
+ tap,
} from 'rxjs/operators';
+import { EMPTY, Observable } from 'rxjs';
+
import {
- EMPTY,
- Observable,
-} from 'rxjs';
+ InAppNotificationsResourceService,
+} from 'core-app/core/state/in-app-notifications/in-app-notifications.service';
+import { IAN_FACET_FILTERS } from 'core-app/features/in-app-notifications/center/state/ian-center.store';
import { IanBellQuery } from 'core-app/features/in-app-notifications/bell/state/ian-bell.query';
+import { EffectCallback, EffectHandler } from 'core-app/core/state/effects/effect-handler.decorator';
import {
- EffectCallback,
- EffectHandler,
-} from 'core-app/core/state/effects/effect-handler.decorator';
-import {
- notificationsMarkedRead,
notificationCountIncreased,
+ notificationsMarkedRead,
} from 'core-app/core/state/in-app-notifications/in-app-notifications.actions';
import { ActionsService } from 'core-app/core/state/actions/actions.service';
+import { IanBellStore } from 'core-app/features/in-app-notifications/bell/state/ian-bell.store';
/**
* The BellService is injected into root here (and the store is thus made global),
@@ -74,6 +97,10 @@ export class IanBellService {
@EffectCallback(notificationsMarkedRead)
private reloadOnNotificationRead(action:ReturnType<typeof notificationsMarkedRead>) {
- this.store.update(({ totalUnread }) => ({ totalUnread: totalUnread - action.notifications.length }));
+ if (action.all) {
+ this.fetchUnread().subscribe();
+ } else {
+ this.store.update(({ totalUnread }) => ({ totalUnread: totalUnread - action.notifications.length }));
+ }
}
}
diff --git a/frontend/src/app/features/in-app-notifications/center/empty-state/empty-state.component.html b/frontend/src/app/features/in-app-notifications/center/empty-state/empty-state.component.html
index c4067bde5d3..18d578153fa 100644
--- a/frontend/src/app/features/in-app-notifications/center/empty-state/empty-state.component.html
+++ b/frontend/src/app/features/in-app-notifications/center/empty-state/empty-state.component.html
@@ -13,7 +13,7 @@
<ng-template #noNotification>
<img [src]="image.no_notification" class="op-empty-state--content-image"/>
<p class="op-empty-state--content-text">
- <span [textContent]="noNotificationText(hasNotifications, (totalCount$ | async))"></span>
+ <span [textContent]="text.no_notification"></span>
</p>
</ng-template>
diff --git a/frontend/src/app/features/in-app-notifications/center/empty-state/empty-state.component.ts b/frontend/src/app/features/in-app-notifications/center/empty-state/empty-state.component.ts
index a86949b07e5..985230e1788 100644
--- a/frontend/src/app/features/in-app-notifications/center/empty-state/empty-state.component.ts
+++ b/frontend/src/app/features/in-app-notifications/center/empty-state/empty-state.component.ts
@@ -30,15 +30,10 @@ import {
ChangeDetectionStrategy,
Component,
} from '@angular/core';
+
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { imagePath } from 'core-app/shared/helpers/images/path-helper';
import { IanCenterService } from '../state/ian-center.service';
-import {
- debounceTime,
- distinctUntilChanged,
-} from 'rxjs/operators';
-import { IanBellService } from 'core-app/features/in-app-notifications/bell/state/ian-bell.service';
-import { combineLatest } from 'rxjs';
+import { imagePath } from 'core-app/shared/helpers/images/path-helper';
@Component({
templateUrl: './empty-state.component.html',
@@ -55,24 +50,16 @@ export class EmptyStateComponent {
text = {
no_notification: this.I18n.t('js.notifications.center.empty_state.no_notification'),
- no_notification_with_current_filter: this.I18n.t('js.notifications.center.empty_state.no_notification_with_current_filter'),
no_selection: this.I18n.t('js.notifications.center.empty_state.no_selection'),
};
hasNotifications$ = this.storeService.hasNotifications$;
- totalCount$ = this.bellService.unread$;
-
loading$ = this.storeService.query.selectLoading();
constructor(
readonly I18n:I18nService,
readonly storeService:IanCenterService,
- readonly bellService:IanBellService,
) {
}
-
- noNotificationText(hasNotifications:boolean, totalNotifications:number):string {
- return (!hasNotifications && totalNotifications > 0) ? this.text.no_notification_with_current_filter : this.text.no_notification;
- }
}
diff --git a/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.html b/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.html
index 1f706830cf9..d200bad97fe 100644
--- a/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.html
+++ b/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.html
@@ -24,7 +24,7 @@
<div class="op-ian-center--loading-indicator">
<img [src]="image.no_notification" class="op-ian-center-loading-image"/>
<p class="op-ian-center-loading-text">
- <span [textContent]="noNotificationText(hasNotifications, (totalCount$ | async))"></span>
+ <span [textContent]="noNotificationText((totalCount$ | async) > 0)"></span>
</p>
<span
diff --git a/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.ts b/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.ts
index 933f5d751c8..d2165dcc113 100644
--- a/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.ts
+++ b/frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.ts
@@ -1,3 +1,31 @@
+// -- copyright
+// OpenProject is an open source project management software.
+// Copyright (C) 2012-2023 the OpenProject GmbH
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License version 3.
+//
+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+// Copyright (C) 2006-2013 Jean-Philippe Lang
+// Copyright (C) 2010-2013 the ChiliProject Team
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+// See COPYRIGHT and LICENSE files for more details.
+//++
+
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
@@ -54,8 +82,6 @@ export class InAppNotificationCenterComponent implements OnInit {
stateChanged$ = this.storeService.stateChanged$;
- originalOrder = ():number => 0;
-
reasonMenuItems = [
{
key: 'mentioned',
@@ -132,8 +158,8 @@ export class InAppNotificationCenterComponent implements OnInit {
});
}
- noNotificationText(hasNotifications:boolean, totalNotifications:number):string {
- if (!(!hasNotifications && totalNotifications > 0)) {
+ noNotificationText(hasNotifications:boolean):string {
+ if (!hasNotifications) {
return this.text.no_notification;
}
return (this.uiRouterGlobals.params.filter === 'project' ? this.text.no_notification_with_current_filter_project : this.text.no_notification_with_current_filter);
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 4db86c7324f..1a514521767 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
@@ -1,7 +1,32 @@
-import {
- Injectable,
- Injector,
-} from '@angular/core';
+// -- copyright
+// OpenProject is an open source project management software.
+// Copyright (C) 2012-2023 the OpenProject GmbH
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License version 3.
+//
+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+// Copyright (C) 2006-2013 Jean-Philippe Lang
+// Copyright (C) 2010-2013 the ChiliProject Team
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+// See COPYRIGHT and LICENSE files for more details.
+//++
+
+import { Injectable, Injector } from '@angular/core';
import {
debounceTime,
defaultIfEmpty,
@@ -20,49 +45,38 @@ import {
Observable,
Subject,
} from 'rxjs';
-import {
- ID,
- Query,
-} from '@datorama/akita';
+import { ID, Query } from '@datorama/akita';
+import { UIRouterGlobals } from '@uirouter/core';
+import { StateService } from '@uirouter/angular';
+
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import {
- IToast,
- ToastService,
-} from 'core-app/shared/components/toaster/toast.service';
+import { IToast, ToastService } from 'core-app/shared/components/toaster/toast.service';
import {
centerUpdatedInPlace,
markNotificationsAsRead,
+ markNotificationsAsReadByFilters,
notificationCountIncreased,
notificationsMarkedRead,
} from 'core-app/core/state/in-app-notifications/in-app-notifications.actions';
import { INotification } from 'core-app/core/state/in-app-notifications/in-app-notification.model';
-import {
- EffectCallback,
- EffectHandler,
-} from 'core-app/core/state/effects/effect-handler.decorator';
+import { EffectCallback, EffectHandler } from 'core-app/core/state/effects/effect-handler.decorator';
import { ActionsService } from 'core-app/core/state/actions/actions.service';
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
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 {
- collectionKey,
- mapHALCollectionToIDCollection,
-} from 'core-app/core/state/collection-store';
+ InAppNotificationsResourceService,
+} from 'core-app/core/state/in-app-notifications/in-app-notifications.service';
+import { mapHALCollectionToIDCollection } from 'core-app/core/state/collection-store';
import { INotificationPageQueryParameters } from 'core-app/features/in-app-notifications/in-app-notifications.routes';
import {
IAN_FACET_FILTERS,
IanCenterStore,
InAppNotificationFacet,
-} from './ian-center.store';
+} from 'core-app/features/in-app-notifications/center/state/ian-center.store';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
-import { UIRouterGlobals } from '@uirouter/core';
-import { StateService } from '@uirouter/angular';
import idFromLink from 'core-app/features/hal/helpers/id-from-link';
import { DeviceService } from 'core-app/core/browser/device.service';
-import {
- ApiV3ListFilter,
- ApiV3ListParameters,
-} from 'core-app/core/apiv3/paths/apiv3-list-resource.interface';
+import { ApiV3ListFilter, ApiV3ListParameters } from 'core-app/core/apiv3/paths/apiv3-list-resource.interface';
@Injectable()
@EffectHandler
@@ -77,8 +91,6 @@ export class IanCenterService extends UntilDestroyedMixin {
notLoaded$ = this.query.select('notLoaded');
- paramsChanges$ = this.query.select(['params', 'activeFacet']);
-
activeCollection$ = this.query.select('activeCollection');
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -248,24 +260,17 @@ export class IanCenterService extends UntilDestroyedMixin {
}
markAllAsRead():void {
- const key = collectionKey(this.params);
- this
- .resourceService
- .collection(key)
- .pipe(
- take(1),
- )
- .subscribe((elements) => {
- const ids:ID[] = elements
- .filter((notification) => notification.readIAN === false)
- .map((notification) => notification.id);
+ const filters = this.params.filters;
+ if (filters === undefined) {
+ return;
+ }
- if (ids.length > 0) {
- this.markAsRead(ids);
- }
- });
+ this.actions$.dispatch(
+ markNotificationsAsReadByFilters({ origin: this.id, filters }),
+ );
}
+ // eslint-disable-next-line @typescript-eslint/no-inferrable-types
openSplitScreen(wpId:string|null, tabIdentifier:string = 'activity'):void {
void this.state.go(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/restrict-template-expressions
@@ -275,16 +280,15 @@ export class IanCenterService extends UntilDestroyedMixin {
}
goToCenter():void {
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/restrict-template-expressions
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-argument
void this.state.go(this.state.current.data.baseRoute);
}
showNextNotification():void {
void this
.notifications$
- .pipe(
- take(1),
- ).subscribe((notifications:INotification[][]) => {
+ .pipe(take(1))
+ .subscribe((notifications:INotification[][]) => {
if (notifications.length <= 0) {
void this.state.go(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/restrict-template-expressions
@@ -341,6 +345,11 @@ export class IanCenterService extends UntilDestroyedMixin {
*/
@EffectCallback(notificationsMarkedRead)
private reloadOnNotificationRead(action:ReturnType<typeof notificationsMarkedRead>) {
+ if (action.all) {
+ this.store.update({ activeCollection: { ids: [] } });
+ return;
+ }
+
const { activeCollection } = this.query.getValue();
this.store.update({
activeCollection: {