2019-01-08 06:32:35 +01:00
|
|
|
import { Component } from '@angular/core';
|
2018-06-09 19:59:09 +02:00
|
|
|
import { Router } from '@angular/router';
|
|
|
|
|
2021-06-07 20:13:58 +02:00
|
|
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
|
|
|
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
|
|
|
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
|
|
|
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
2021-10-20 18:30:04 +02:00
|
|
|
import { LogService } from 'jslib-common/abstractions/log.service';
|
2021-06-07 20:13:58 +02:00
|
|
|
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
|
|
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
|
|
|
import { StateService } from 'jslib-common/abstractions/state.service';
|
|
|
|
import { StorageService } from 'jslib-common/abstractions/storage.service';
|
|
|
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
|
|
|
import { VaultTimeoutService } from 'jslib-common/abstractions/vaultTimeout.service';
|
2018-06-09 19:59:09 +02:00
|
|
|
|
2018-06-10 04:40:53 +02:00
|
|
|
import { RouterService } from '../services/router.service';
|
|
|
|
|
2021-06-07 20:13:58 +02:00
|
|
|
import { LockComponent as BaseLockComponent } from 'jslib-angular/components/lock.component';
|
2018-06-09 19:59:09 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-lock',
|
|
|
|
templateUrl: 'lock.component.html',
|
|
|
|
})
|
2019-01-08 06:32:35 +01:00
|
|
|
export class LockComponent extends BaseLockComponent {
|
2018-10-03 16:33:04 +02:00
|
|
|
constructor(router: Router, i18nService: I18nService,
|
2018-06-09 19:59:09 +02:00
|
|
|
platformUtilsService: PlatformUtilsService, messagingService: MessagingService,
|
2018-06-10 04:40:53 +02:00
|
|
|
userService: UserService, cryptoService: CryptoService,
|
2020-03-30 16:59:47 +02:00
|
|
|
storageService: StorageService, vaultTimeoutService: VaultTimeoutService,
|
2019-07-02 14:44:29 +02:00
|
|
|
environmentService: EnvironmentService, private routerService: RouterService,
|
2021-10-20 18:30:04 +02:00
|
|
|
stateService: StateService, apiService: ApiService, logService: LogService) {
|
2019-02-13 21:32:41 +01:00
|
|
|
super(router, i18nService, platformUtilsService, messagingService, userService, cryptoService,
|
2021-10-20 18:30:04 +02:00
|
|
|
storageService, vaultTimeoutService, environmentService, stateService, apiService, logService);
|
2018-06-09 19:59:09 +02:00
|
|
|
}
|
2018-06-10 04:02:45 +02:00
|
|
|
|
|
|
|
async ngOnInit() {
|
2019-01-08 06:32:35 +01:00
|
|
|
await super.ngOnInit();
|
2019-02-22 19:17:10 +01:00
|
|
|
this.onSuccessfulSubmit = () => {
|
|
|
|
const previousUrl = this.routerService.getPreviousUrl();
|
|
|
|
if (previousUrl !== '/' && previousUrl.indexOf('lock') === -1) {
|
|
|
|
this.successRoute = previousUrl;
|
|
|
|
}
|
|
|
|
this.router.navigate([this.successRoute]);
|
|
|
|
};
|
2018-06-10 04:02:45 +02:00
|
|
|
}
|
2018-06-09 19:59:09 +02:00
|
|
|
}
|