From 66d663b8bc5a5ee228e06d3054ebc181dbded30e Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Fri, 13 Jan 2023 11:40:50 +0100 Subject: [PATCH] Fixing shared login bug of needs refresh after entering the password. fixes #591 --- src/frontend/app/model/navigation.service.ts | 8 +++++--- src/frontend/app/ui/sharelogin/share-login.component.html | 2 +- src/frontend/app/ui/sharelogin/share-login.component.ts | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/frontend/app/model/navigation.service.ts b/src/frontend/app/model/navigation.service.ts index e705dd24..390ae60b 100644 --- a/src/frontend/app/model/navigation.service.ts +++ b/src/frontend/app/model/navigation.service.ts @@ -1,6 +1,6 @@ import {Injectable} from '@angular/core'; -import {Router} from '@angular/router'; +import {IsActiveMatchOptions, Router} from '@angular/router'; import {ShareService} from '../ui/gallery/share.service'; import {Config} from '../../../common/config/public/Config'; import {NavigationLinkTypes} from '../../../common/config/public/ClientConfig'; @@ -12,8 +12,10 @@ export class NavigationService { public isLoginPage(): boolean { return ( - this.router.isActive('login', true) || - this.router.isActive('shareLogin', true) + this.router.isActive('login', + {paths: 'exact', queryParams: 'exact', fragment: 'ignored', matrixParams: 'ignored'} as IsActiveMatchOptions) || + this.router.isActive('shareLogin', + {paths: 'exact', queryParams: 'ignored', fragment: 'ignored', matrixParams: 'ignored'} as IsActiveMatchOptions) ); } diff --git a/src/frontend/app/ui/sharelogin/share-login.component.html b/src/frontend/app/ui/sharelogin/share-login.component.html index ca37f4cc..86e4d99b 100644 --- a/src/frontend/app/ui/sharelogin/share-login.component.html +++ b/src/frontend/app/ui/sharelogin/share-login.component.html @@ -28,7 +28,7 @@
diff --git a/src/frontend/app/ui/sharelogin/share-login.component.ts b/src/frontend/app/ui/sharelogin/share-login.component.ts index b0969179..740839aa 100644 --- a/src/frontend/app/ui/sharelogin/share-login.component.ts +++ b/src/frontend/app/ui/sharelogin/share-login.component.ts @@ -12,6 +12,7 @@ import {NavigationService} from '../../model/navigation.service'; export class ShareLoginComponent implements OnInit { password: string; loginError = false; + inProgress = false; title: string; constructor( @@ -30,6 +31,7 @@ export class ShareLoginComponent implements OnInit { async onLogin(): Promise { this.loginError = false; + this.inProgress = true; try { await this.authService.shareLogin(this.password); } catch (error) { @@ -40,6 +42,8 @@ export class ShareLoginComponent implements OnInit { this.loginError = true; } } + + this.inProgress = false; } }