mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
Improve service
This commit is contained in:
+4
-4
@@ -1,13 +1,13 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SenderService } from './sender.service';
|
||||
import { BackgroundService } from './background.service';
|
||||
|
||||
describe('SenderService', () => {
|
||||
let service: SenderService;
|
||||
describe('BackgroundService', () => {
|
||||
let service: BackgroundService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(SenderService);
|
||||
service = TestBed.inject(BackgroundService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
@@ -3,7 +3,7 @@ import { Injectable } from '@angular/core';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SenderService {
|
||||
export class BackgroundService {
|
||||
|
||||
constructor() { }
|
||||
}
|
||||
@@ -1,14 +1,15 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { BackgroundService } from '../background.service';
|
||||
|
||||
export interface wss{
|
||||
|
||||
url: string,
|
||||
type: 'reflect' | 'emit'
|
||||
header: {
|
||||
id: string
|
||||
bluePrint: string,
|
||||
jwt: string
|
||||
id: string
|
||||
bluePrint: string,
|
||||
jwt: string
|
||||
}
|
||||
|
||||
}
|
||||
@@ -25,6 +26,7 @@ export class SynchroService {
|
||||
private url: string = ''
|
||||
callback = function(){}
|
||||
private _connected = false;
|
||||
private BackgroundService = new BackgroundService()
|
||||
|
||||
constructor(){}
|
||||
|
||||
@@ -60,11 +62,8 @@ export class SynchroService {
|
||||
}
|
||||
|
||||
private onopen = () =>{
|
||||
document.body.style.setProperty(`--color`, "#0782C9");
|
||||
document.body.style.setProperty(`--color2`, "#45BAFF");
|
||||
document.body.style.setProperty(`--color3`, "#0782C9");
|
||||
document.body.style.setProperty(`--color4`, "#0782c9f0");
|
||||
document.body.style.setProperty(`--color5`, "#45BAFF");
|
||||
|
||||
this.BackgroundService.online()
|
||||
console.log('open ======================= welcome to socket server')
|
||||
this._connected = true
|
||||
|
||||
@@ -96,11 +95,7 @@ export class SynchroService {
|
||||
// event.code is usually 1006 in this case
|
||||
console.log('[close] Connection died');
|
||||
console.log('Reconnect')
|
||||
document.body.style.setProperty(`--color`, "#ffb703");
|
||||
document.body.style.setProperty(`--color2`, "#ffb703");
|
||||
document.body.style.setProperty(`--color3`, "#ffb703");
|
||||
document.body.style.setProperty(`--color4`, "#ffb703");
|
||||
document.body.style.setProperty(`--color5`, "#ffb703");
|
||||
this.BackgroundService.offline();
|
||||
this._connected = false
|
||||
this.connect()
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AnimationController, ModalController } from '@ionic/angular';
|
||||
import { MenuController } from '@ionic/angular';
|
||||
import { Router } from '@angular/router';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { ProfilePage } from 'src/app/modals/profile/profile.page';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
@@ -19,10 +17,8 @@ export class HeaderNoSearchPage implements OnInit {
|
||||
SessionStore = SessionStore
|
||||
|
||||
constructor(private modalController: ModalController,
|
||||
private menu: MenuController,
|
||||
private animationController: AnimationController,
|
||||
private router: Router,
|
||||
authService: AuthService) {
|
||||
private router: Router) {
|
||||
|
||||
this.loggeduser = SessionStore.user;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user