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

change the if conditions and use class name for element selecting

bsatarnejadbdd1d623b053
diff --git a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller.ts b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller.ts
index a670f780c9a..6dba56e91fe 100644
--- a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller.ts
+++ b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller.ts
@@ -145,18 +145,20 @@ export class ActivityPanelBaseController extends UntilDestroyedMixin implements
protected scrollToUnreadNotification():void {
// scroll to the unread notification only if there is no deep link
- if (!(window.location.href.indexOf('activity#') > -1)) {
- const unreadNotifications = document.querySelectorAll('[data-qa-selector="user-activity-bubble"]');
- const unreadNotificationsLength = unreadNotifications?.length;
- if (unreadNotificationsLength && this.notifications.length) {
- if (this.reverse) {
- unreadNotifications[unreadNotificationsLength - 1].classList.add('op-user-activity--unread-notification-bubble_scrolled');
- unreadNotifications[unreadNotificationsLength - 1].scrollIntoView();
- } else {
- unreadNotifications[0].classList.add('op-user-activity--unread-notification-bubble_scrolled');
- unreadNotifications[0].scrollIntoView();
- }
- }
+ if (window.location.href.indexOf('activity#') > -1 ) {
+ return;
+ }
+ const unreadNotifications = document.querySelectorAll('.comments-number--bubble');
+ const unreadNotificationsLength = unreadNotifications?.length;
+ if (!unreadNotificationsLength) {
+ return;
+ }
+ if (this.reverse) {
+ unreadNotifications[unreadNotificationsLength - 1].classList.add('op-user-activity--unread-notification-bubble_scrolled');
+ unreadNotifications[unreadNotificationsLength - 1].scrollIntoView();
+ } else {
+ unreadNotifications[0].classList.add('op-user-activity--unread-notification-bubble_scrolled');
+ unreadNotifications[0].scrollIntoView();
}
}