This commit is contained in:
Peter Maquiran
2023-05-29 11:51:08 +01:00
parent b2da8463b4
commit ee14fbe8e7
11 changed files with 51 additions and 142 deletions
+18
View File
@@ -30,6 +30,8 @@ export class AuthService {
public isWsAuthenticated: boolean = false;
opts:any;
tabIsActive = true
constructor(
private http: HttpClient,
private storageService:StorageService,
@@ -52,6 +54,22 @@ export class AuthService {
}
}
window.addEventListener('focus', (event) => {
if(!this.tabIsActive) {
this.tabIsActive = true
const data = SessionStore.getDataFromLocalStorage();
if(!data?.user?.Authorization && SessionStore?.user?.Authorization) {
window.location.reload();
}
}
});
window.addEventListener('blur', (event) => {
this.tabIsActive = false
});
}
async login(user: UserForm, {saveSession = true}): Promise<LoginUserRespose> {
+2 -2
View File
@@ -168,9 +168,8 @@ export class TaskService {
try {
await this.loadExpedientes()
this.loadCount = true;
this.showLoader = false;
} catch(error) {
this.showLoader = false
this.loadCount = true;
}
@@ -187,6 +186,7 @@ export class TaskService {
await this.loadEventosParaAprovacao()
this.loadCount = true
this.showLoader = false;
}
async loadDespachos() {