This repository was archived by the owner on Nov 17, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
src/Web/WebMVC/Views/Shared Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change 9696 if (' @User.Identity.IsAuthenticated' === ' True' ) {
9797 var timerId;
9898
99- let connection = stablishConnection ();
100-
101- connection .start ().then (function () {
102- console .log (' User Registered to Signalr Hub' );
103- });
104-
105- registerNotificationHandlers (connection);
99+ stablishConnection ((conn ) => registerNotificationHandlers (conn));
106100 }
107101
108- function stablishConnection () {
109- return new signalR.HubConnectionBuilder ()
102+ function stablishConnection (cb ) {
103+ let connection = new signalR.HubConnectionBuilder ()
110104 .withUrl (' @settings.Value.SignalrHubUrl/hub/notificationhub' , {
111105 transport: signalR .HttpTransportType .LongPolling ,
112106 accessTokenFactory : () => {
113107 return " Authorization" , getToken ();
114108 }
115109 })
116- .build ();
110+ .build ();
111+
112+ connection .start ().then (function () {
113+ console .log (' User Registered to Signalr Hub' );
114+ cb (connection);
115+ });
117116 }
118117
119118 function registerNotificationHandlers (connection ) {
You can’t perform that action at this time.
0 commit comments