Skip to content

Commit 1aef91d

Browse files
committed
initSignalR add callback parameter
1 parent a4a6a32 commit 1aef91d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

angular/src/shared/helpers/SignalRAspNetCoreHelper.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { AppConsts } from '@shared/AppConsts';
22
import { UtilsService } from '@abp/utils/utils.service';
33

44
export class SignalRAspNetCoreHelper {
5-
static initSignalR(): void {
6-
5+
static initSignalR(callback?: () => void): void {
76
const encryptedAuthToken = new UtilsService().getCookieValue(AppConsts.authorization.encrptedAuthTokenName);
87

98
abp.signalr = {
@@ -17,6 +16,11 @@ export class SignalRAspNetCoreHelper {
1716
};
1817

1918
const script = document.createElement('script');
19+
if (callback) {
20+
script.onload = () => {
21+
callback();
22+
};
23+
}
2024
script.src = AppConsts.appBaseUrl + '/assets/abp/abp.signalr-client.js';
2125
document.head.appendChild(script);
2226
}

0 commit comments

Comments
 (0)