Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite40ea25

Browse files
fix: fix double ws connection for notifications (#17044)
**Issue:**The UI was creating two web socket connections to receive notificationupdates causing duplicated values.**Cause:**We were rendering the notification container twice. One for the desktopnav and another for mobile.**Fix:**Only use one notification container for the nav.**Improvements for later:**I think would be better at some point to move the networking and datalogic into a provider but it would require testing and some tiny rework.Since the actual fix works well, and it is not complex or difficult, Ithink it is ok to stay with it until we require to load notifications inmore places.
1 parent1593861 commite40ea25

File tree

1 file changed

+30
-34
lines changed

1 file changed

+30
-34
lines changed

‎site/src/modules/dashboard/Navbar/NavbarView.tsx

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,21 @@ export const NavbarView: FC<NavbarViewProps> = ({
5555

5656
<NavItemsclassName="ml-4"/>
5757

58-
<divclassName="hidden md:flex items-center gap-3 ml-auto">
58+
<divclassName="flex items-center gap-3 ml-auto">
5959
{proxyContextValue&&(
60-
<ProxyMenuproxyContextValue={proxyContextValue}/>
60+
<divclassName="hidden md:block">
61+
<ProxyMenuproxyContextValue={proxyContextValue}/>
62+
</div>
6163
)}
6264

63-
<DeploymentDropdown
64-
canViewAuditLog={canViewAuditLog}
65-
canViewOrganizations={canViewOrganizations}
66-
canViewDeployment={canViewDeployment}
67-
canViewHealth={canViewHealth}
68-
/>
65+
<divclassName="hidden md:block">
66+
<DeploymentDropdown
67+
canViewAuditLog={canViewAuditLog}
68+
canViewOrganizations={canViewOrganizations}
69+
canViewDeployment={canViewDeployment}
70+
canViewHealth={canViewHealth}
71+
/>
72+
</div>
6973

7074
<NotificationsInbox
7175
fetchNotifications={API.getInboxNotifications}
@@ -78,36 +82,28 @@ export const NavbarView: FC<NavbarViewProps> = ({
7882
/>
7983

8084
{user&&(
81-
<UserDropdown
85+
<divclassName="hidden md:block">
86+
<UserDropdown
87+
user={user}
88+
buildInfo={buildInfo}
89+
supportLinks={supportLinks}
90+
onSignOut={onSignOut}
91+
/>
92+
</div>
93+
)}
94+
95+
<divclassName="md:hidden">
96+
<MobileMenu
97+
proxyContextValue={proxyContextValue}
8298
user={user}
83-
buildInfo={buildInfo}
8499
supportLinks={supportLinks}
85100
onSignOut={onSignOut}
101+
canViewAuditLog={canViewAuditLog}
102+
canViewOrganizations={canViewOrganizations}
103+
canViewDeployment={canViewDeployment}
104+
canViewHealth={canViewHealth}
86105
/>
87-
)}
88-
</div>
89-
90-
<divclassName="ml-auto flex items-center gap-3 md:hidden">
91-
<NotificationsInbox
92-
fetchNotifications={API.getInboxNotifications}
93-
markAllAsRead={API.markAllInboxNotificationsAsRead}
94-
markNotificationAsRead={(notificationId)=>
95-
API.updateInboxNotificationReadStatus(notificationId,{
96-
is_read:true,
97-
})
98-
}
99-
/>
100-
101-
<MobileMenu
102-
proxyContextValue={proxyContextValue}
103-
user={user}
104-
supportLinks={supportLinks}
105-
onSignOut={onSignOut}
106-
canViewAuditLog={canViewAuditLog}
107-
canViewOrganizations={canViewOrganizations}
108-
canViewDeployment={canViewDeployment}
109-
canViewHealth={canViewHealth}
110-
/>
106+
</div>
111107
</div>
112108
</div>
113109
);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp