-- FIX. SIGNALR HUB NOTIFIFICACIONES
This commit is contained in:
@@ -14,16 +14,16 @@ var NotificacionesADS = function () {
|
||||
if (Notification.permission !== 'denied') {
|
||||
Notification.requestPermission(function (permission) {
|
||||
// If the user accepts, let's create a notification
|
||||
//if (permission === "granted") {
|
||||
//}
|
||||
if (permission === "granted") {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------- Eventos ----------------------------------------------------------------------
|
||||
var AlertaVentana = function (Titulo, Mensaje, Tipo, timeoutseconds, Opciones) {
|
||||
var AlertaVentana = function (Titulo, Mensaje, Tipo, timeoutseconds) {
|
||||
console.log(Mensaje);
|
||||
let obj = { metodo: "AlertaVentana", titulo: Titulo, mensaje: Mensaje, timeout: timeoutseconds, tipo: Tipo, opciones: Opciones, tick: (new Date()).getTime() };
|
||||
let obj = { metodo: "AlertaVentana", titulo: Titulo, mensaje: Mensaje, timeout: timeoutseconds, tipo: Tipo, tick: (new Date()).getTime() };
|
||||
let myjson = JSON.stringify(obj);
|
||||
localStorage.setItem("ADSNotificaciones", myjson);
|
||||
execAlertaVentana(obj);
|
||||
@@ -117,11 +117,11 @@ var NotificacionesADS = function () {
|
||||
var proxy = $.connection.notificaciones;
|
||||
/*$.connection.hub.url = '/signalr';*/
|
||||
$.connection.hub.disconnected(function () {
|
||||
console.log(' (SignalR) diconnected');
|
||||
console.log(' (SignalR) disconnected');
|
||||
signalrconectionStar(1200);
|
||||
});
|
||||
|
||||
proxy.client.AlertaVentana = AlertaVentana;
|
||||
proxy.client.alertaVentana = AlertaVentana;
|
||||
|
||||
proxy.client.Execstring = Execstring;
|
||||
|
||||
@@ -139,7 +139,7 @@ var NotificacionesADS = function () {
|
||||
nointentos = nointentos + 1;
|
||||
if (nointentos < maxintentos) {
|
||||
$.connection.hub.start().done(function () { console.log('(SignalR)Bienvenido'); nointentos = 0; })
|
||||
.fail(function () { console.log(' (SignalR) no conectado (Intento:' + nointentos + ')'); signalrconectionStar(12000); });
|
||||
.fail(function () { console.log(' (SignalR) no conectado (Intento:' + nointentos + ')'); signalrconectionStar(1200); });
|
||||
}
|
||||
}, TimeOut);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user