mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Improve
This commit is contained in:
@@ -16,14 +16,10 @@ export class InactivityGuard implements CanActivate {
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
|
||||
alert(SessionStore.exist +' '+SessionStore.user.Inactivity + ' '+ !SessionStore.hasPin)
|
||||
|
||||
if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin) {
|
||||
// alert('stay set pin')
|
||||
return true
|
||||
|
||||
if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin) {
|
||||
return true
|
||||
} else if(SessionStore.exist && !SessionStore.user.Inactivity) {
|
||||
// alert('stay conform')
|
||||
return true
|
||||
} else {
|
||||
this.router.navigate(['/home/events']);
|
||||
|
||||
@@ -161,9 +161,9 @@ export class HomePage implements OnInit {
|
||||
}
|
||||
)
|
||||
|
||||
synchro.registerCallback('Notification', (DataArray)=> {
|
||||
alert('nice')
|
||||
}, 'any')
|
||||
// synchro.registerCallback('Notification', (DataArray)=> {
|
||||
|
||||
// }, 'any')
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import { EditProfilePage } from './edit-profile/edit-profile.page';
|
||||
import { JsonStore } from '../../services/jsonStore.service';
|
||||
import { StorageService } from '../../services/storage.service';
|
||||
import { NotificationsService } from '../../services/notifications.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-profile',
|
||||
@@ -212,6 +213,7 @@ export class ProfilePage implements OnInit {
|
||||
|
||||
logout() {
|
||||
window.localStorage.clear();
|
||||
SessionStore.delete();
|
||||
|
||||
setTimeout(() => {
|
||||
this.router.navigateByUrl('/', { replaceUrl: true });
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { NetworkService } from './network.service';
|
||||
|
||||
describe('NavigationService', () => {
|
||||
let service: NetworkService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(NetworkService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,31 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Network } from '@ionic-native/network/ngx';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { fromEvent, merge, of, Observable } from 'rxjs';
|
||||
import { mapTo } from 'rxjs/operators';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NetworkService {
|
||||
|
||||
constructor(
|
||||
private network: Network) { }
|
||||
|
||||
checkNetworkConnection(){
|
||||
this.network.onConnect().subscribe((value) => {
|
||||
|
||||
document.body.style.setProperty(`--color`, "#0782C9");
|
||||
|
||||
console.log('network connected!',value);
|
||||
});
|
||||
}
|
||||
|
||||
checkNetworkDisconnection(){
|
||||
this.network.onDisconnect().subscribe((value) => {
|
||||
document.body.style.setProperty(`--color`, "#eeeb30");
|
||||
console.log('network was disconnected :-('),value;
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,7 @@ class SessionService {
|
||||
return false
|
||||
}
|
||||
return this._user.PIN.length >= 2
|
||||
|
||||
}
|
||||
|
||||
reset(user) {
|
||||
|
||||
Reference in New Issue
Block a user