mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Inicio page is offline
This commit is contained in:
@@ -3,6 +3,7 @@ import { SessionStore } from 'src/app/store/session.service';
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { BackgroundService } from '../background.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { EventTrigger } from '../eventTrigger.service'
|
||||
|
||||
export interface wss{
|
||||
|
||||
@@ -28,6 +29,7 @@ class SynchroService {
|
||||
private url: string = ''
|
||||
callback = function(){}
|
||||
private _connected = false;
|
||||
private eventtrigger: EventTrigger;
|
||||
private BackgroundService = new BackgroundService()
|
||||
callBacks: {
|
||||
type: 'Offline' | 'Online' | 'Onmessage' | 'Chat' | 'Notification' | 'Notifications' | '',
|
||||
@@ -81,7 +83,7 @@ class SynchroService {
|
||||
|
||||
|
||||
|
||||
if(!this.conected) {
|
||||
//if(!this._connected) {
|
||||
|
||||
this.BackgroundService.online()
|
||||
this.callBacks.forEach((e)=>{
|
||||
@@ -90,9 +92,13 @@ class SynchroService {
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
console.log('open ======================= welcome to socket server')
|
||||
this.eventtrigger.publishSomeData({
|
||||
internet: "online"
|
||||
})
|
||||
|
||||
this._connected = true
|
||||
|
||||
// send all saved data due to internet connection
|
||||
@@ -177,14 +183,15 @@ class SynchroService {
|
||||
|
||||
|
||||
|
||||
if(this._connected) {
|
||||
// if(this._connected){
|
||||
this.BackgroundService.offline();
|
||||
this.callBacks.forEach((e)=>{
|
||||
if(e.type == 'Offline') {
|
||||
e.funx()
|
||||
}
|
||||
})
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
// status
|
||||
this._connected = false
|
||||
|
||||
Reference in New Issue
Block a user