Fixed issue webmvc signalr not notifying submitting state
This commit is contained in:
parent
ad76fa01ad
commit
cdeaa30b2f
@ -96,24 +96,23 @@
|
||||
if ('@User.Identity.IsAuthenticated' === 'True') {
|
||||
var timerId;
|
||||
|
||||
let connection = stablishConnection();
|
||||
|
||||
connection.start().then(function () {
|
||||
console.log('User Registered to Signalr Hub');
|
||||
});
|
||||
|
||||
registerNotificationHandlers(connection);
|
||||
stablishConnection((conn) => registerNotificationHandlers(conn));
|
||||
}
|
||||
|
||||
function stablishConnection() {
|
||||
return new signalR.HubConnectionBuilder()
|
||||
function stablishConnection(cb) {
|
||||
let connection = new signalR.HubConnectionBuilder()
|
||||
.withUrl('@settings.Value.SignalrHubUrl/hub/notificationhub', {
|
||||
transport: signalR.HttpTransportType.LongPolling,
|
||||
accessTokenFactory: () => {
|
||||
return "Authorization", getToken();
|
||||
}
|
||||
})
|
||||
.build();
|
||||
.build();
|
||||
|
||||
connection.start().then(function () {
|
||||
console.log('User Registered to Signalr Hub');
|
||||
cb(connection);
|
||||
});
|
||||
}
|
||||
|
||||
function registerNotificationHandlers(connection) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user