mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
fix
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user