﻿var abp = abp || {};
(function ($) {

    if (!$ || !$.connection) {
        return;
    }

    //TODO: Check if ABP's SignalR hub is enabled..?

    abp.signalr = abp.signalr || {};
    abp.signalr.hubs = abp.signalr.hubs || {};
    abp.signalr.hubs.common = $.connection.abpCommonHub;

    var commonHub = abp.signalr.hubs.common;
    if (!commonHub) {
        return;
    }

    commonHub.client.getNotification = function (notification) {
        abp.event.trigger('abp.notifications.received', notification);
    };

    //TODO: Check connection state and only connect if not connected?
    $.connection.hub.start().done(function () {
        abp.log.debug('Connected to SignalR server!'); //TODO: Remove log
    });

})(jQuery);
@@ -90,62 +90,8 @@
  %7D%0A%0A
-    //TODO: Check if ABP's SignalR hub is enabled..?%0A%0A
     
@@ -466,78 +466,8 @@
 %7D;%0A%0A
-    //TODO: Check connection state and only connect if not connected?%0A
     
@@ -584,16 +584,166 @@
 ove log%0A
+        commonHub.server.register().done(function () %7B%0A            abp.log.debug('Registered to the SignalR server!'); //TODO: Remove log%0A        %7D);%0A
     %7D);%0A

Call commonhub.register on startup.