This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit b04c4d08 authored by Daniel Crazzolara's avatar Daniel Crazzolara
Browse files

Trying to fix faulty navigation

parent 61bd3184
Branches
2 merge requests!71Merge for September Release,!70Improvement/adapt import to new artemis export
......@@ -60,7 +60,7 @@ export class AccountService {
}
if (account) {
this.navigateToStoredUrl();
this.navigateToStoredUrl().then(() => this.stateStorageService.clearUrl());
}
}),
shareReplay()
......@@ -85,12 +85,13 @@ export class AccountService {
return this.http.get<Account>(SERVER_API_URL + 'api/account');
}
private navigateToStoredUrl(): void {
private navigateToStoredUrl(): Promise<boolean> {
// previousState can be set in the authExpiredInterceptor and in the userRouteAccessService
// if login is successful, go to stored previousState and clear previousState
const previousUrl = this.stateStorageService.getUrl();
if (previousUrl) {
this.router.navigateByUrl(previousUrl).then(() => this.stateStorageService.clearUrl());
return this.router.navigateByUrl(previousUrl);
}
return Promise.resolve(false);
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment