You've already forked pigallery2
mirror of
https://github.com/bpatrik/pigallery2.git
synced 2025-07-17 01:32:29 +02:00
Fixing shared login bug of needs refresh after entering the password.
fixes #591
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
|
|
||||||
import {Router} from '@angular/router';
|
import {IsActiveMatchOptions, Router} from '@angular/router';
|
||||||
import {ShareService} from '../ui/gallery/share.service';
|
import {ShareService} from '../ui/gallery/share.service';
|
||||||
import {Config} from '../../../common/config/public/Config';
|
import {Config} from '../../../common/config/public/Config';
|
||||||
import {NavigationLinkTypes} from '../../../common/config/public/ClientConfig';
|
import {NavigationLinkTypes} from '../../../common/config/public/ClientConfig';
|
||||||
@ -12,8 +12,10 @@ export class NavigationService {
|
|||||||
|
|
||||||
public isLoginPage(): boolean {
|
public isLoginPage(): boolean {
|
||||||
return (
|
return (
|
||||||
this.router.isActive('login', true) ||
|
this.router.isActive('login',
|
||||||
this.router.isActive('shareLogin', true)
|
{paths: 'exact', queryParams: 'exact', fragment: 'ignored', matrixParams: 'ignored'} as IsActiveMatchOptions) ||
|
||||||
|
this.router.isActive('shareLogin',
|
||||||
|
{paths: 'exact', queryParams: 'ignored', fragment: 'ignored', matrixParams: 'ignored'} as IsActiveMatchOptions)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<div class="col-sm-12 controls d-grid gap-2">
|
<div class="col-sm-12 controls d-grid gap-2">
|
||||||
<button class="btn btn-primary btn-lg"
|
<button class="btn btn-primary btn-lg"
|
||||||
[disabled]="!LoginForm.form.valid"
|
[disabled]="!LoginForm.form.valid || inProgress"
|
||||||
type="submit"
|
type="submit"
|
||||||
name="action" i18n>Enter
|
name="action" i18n>Enter
|
||||||
</button>
|
</button>
|
||||||
|
@ -12,6 +12,7 @@ import {NavigationService} from '../../model/navigation.service';
|
|||||||
export class ShareLoginComponent implements OnInit {
|
export class ShareLoginComponent implements OnInit {
|
||||||
password: string;
|
password: string;
|
||||||
loginError = false;
|
loginError = false;
|
||||||
|
inProgress = false;
|
||||||
title: string;
|
title: string;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@ -30,6 +31,7 @@ export class ShareLoginComponent implements OnInit {
|
|||||||
async onLogin(): Promise<void> {
|
async onLogin(): Promise<void> {
|
||||||
this.loginError = false;
|
this.loginError = false;
|
||||||
|
|
||||||
|
this.inProgress = true;
|
||||||
try {
|
try {
|
||||||
await this.authService.shareLogin(this.password);
|
await this.authService.shareLogin(this.password);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -40,6 +42,8 @@ export class ShareLoginComponent implements OnInit {
|
|||||||
this.loginError = true;
|
this.loginError = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.inProgress = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user