Skip to content

Commit 85a0935

Browse files
fix: fixed tab click issue (#612)
1 parent 440230c commit 85a0935

File tree

3 files changed

+22
-30
lines changed

3 files changed

+22
-30
lines changed

src/Notification/NotificationSections.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const NotificationSections = () => {
9494
>
9595
{renderNotificationSection('today', today)}
9696
{renderNotificationSection('earlier', earlier)}
97-
{(hasMorePages === undefined || hasMorePages) && notificationListStatus === RequestStatus.IN_PROGRESS ? (
97+
{notificationListStatus === RequestStatus.IN_PROGRESS ? (
9898
<div className="d-flex justify-content-center p-4">
9999
<Spinner animation="border" variant="primary" size="lg" data-testid="notifications-loading-spinner" />
100100
</div>

src/Notification/index.jsx

+21-21
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ const Notifications = ({ notificationAppData, showLeftMargin }) => {
8181
setAppName(selectedAppName);
8282
setNotificationData(prevData => ({
8383
...prevData,
84-
...{ notificationListStatus: RequestStatus.IDLE },
84+
...{ notificationListStatus: appName === selectedAppName ? RequestStatus.SUCCESSFUL : RequestStatus.IN_PROGRESS },
8585
}));
86-
}, []);
86+
}, [appName]);
8787

8888
const updateNotificationData = useCallback((data) => {
8989
setNotificationData(prevData => ({
@@ -150,13 +150,13 @@ const Notifications = ({ notificationAppData, showLeftMargin }) => {
150150
</NotificationPopoverContext.Provider>
151151
</Popover.Content>
152152
{getConfig().NOTIFICATION_FEEDBACK_URL && (
153-
<Button
154-
onClick={enableFeedback}
155-
variant="warning"
156-
className="notification-feedback-widget"
157-
>
158-
{intl.formatMessage(messages.feedback)}
159-
</Button>
153+
<Button
154+
onClick={enableFeedback}
155+
variant="warning"
156+
className="notification-feedback-widget"
157+
>
158+
{intl.formatMessage(messages.feedback)}
159+
</Button>
160160
)}
161161
</div>
162162
</Popover>
@@ -178,18 +178,18 @@ const Notifications = ({ notificationAppData, showLeftMargin }) => {
178178
data-testid="notification-bell-icon"
179179
/>
180180
{tabsCount?.count > 0 && (
181-
<Bubble
182-
variant="error"
183-
data-testid="notification-count"
184-
className={classNames('notification-badge zindex-1 cursor-pointer p-1', {
185-
'notification-badge-unrounded mt-1': tabsCount.count >= 10,
186-
'notification-badge-rounded': tabsCount.count < 10,
187-
})}
188-
onClick={toggleNotificationTray}
189-
>
190-
{tabsCount.count >= 100 ? <div className="d-flex">99<p className="mb-0 plus-icon">+</p></div>
191-
: tabsCount.count}
192-
</Bubble>
181+
<Bubble
182+
variant="error"
183+
data-testid="notification-count"
184+
className={classNames('notification-badge zindex-1 cursor-pointer p-1', {
185+
'notification-badge-unrounded mt-1': tabsCount.count >= 10,
186+
'notification-badge-rounded': tabsCount.count < 10,
187+
})}
188+
onClick={toggleNotificationTray}
189+
>
190+
{tabsCount.count >= 100 ? <div className="d-flex">99<p className="mb-0 plus-icon">+</p></div>
191+
: tabsCount.count}
192+
</Bubble>
193193
)}
194194
</div>
195195
</OverlayTrigger>

src/Notification/notification.scss

-8
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,6 @@
157157
height: 10px;
158158
width: 10px;
159159
}
160-
161-
.nav-tabs .nav-link {
162-
&:focus {
163-
&::before {
164-
border: none !important;
165-
}
166-
}
167-
}
168160
}
169161

170162
.notification-feedback-widget {

0 commit comments

Comments
 (0)