Offline background color bug fix on init app

This commit is contained in:
Eudes Inácio
2021-11-23 13:55:43 +01:00
parent 6dcc59980c
commit 4f3ba91eb4
2 changed files with 16 additions and 11 deletions
+6 -1
View File
@@ -1,5 +1,6 @@
import { Injectable } from '@angular/core';
import { ThemeService } from 'src/app/services/theme.service';
import { StorageService} from 'src/app/services/storage.service';
@Injectable({
providedIn: 'root'
@@ -13,7 +14,8 @@ export class BackgroundService {
}[] = []
constructor(
private themeservice: ThemeService
private themeservice: ThemeService,
private storageservice: StorageService
) { }
online() {
@@ -24,6 +26,7 @@ export class BackgroundService {
document.body.style.setProperty(`--color3`, "#d9d9d9");
document.body.style.setProperty(`--color4`, "#d9d9d9ee");
document.body.style.setProperty(`--color5`, "#ececec");
this.storageservice.store('networkCheckStore','online');
} else {
document.body.style.setProperty(`--color`, "#0782C9");
@@ -31,6 +34,7 @@ export class BackgroundService {
document.body.style.setProperty(`--color3`, "#0782C9");
document.body.style.setProperty(`--color4`, "#0782c9f0");
document.body.style.setProperty(`--color5`, "#45BAFF");
this.storageservice.store('networkCheckStore','online');
}
this.callBacks.forEach((e) => {
@@ -46,6 +50,7 @@ export class BackgroundService {
document.body.style.setProperty(`--color3`, "#ffb703");
document.body.style.setProperty(`--color4`, "#ffb703");
document.body.style.setProperty(`--color5`, "#ffb703");
this.storageservice.store('networkCheckStore','offline');
this.callBacks.forEach((e) => {
if (e.type == 'Offline') {
e.funx()